Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
Kilimanjaro
on March 11, 2011
|
parent
|
context
|
favorite
| on:
JavaScript Garden
Everyday you learn something new
Number.prototype.times=function(fn){ for(i=0;i<this;i++){ fn(i); } } 3..times(alert)
zoul
on March 12, 2011
|
next
[–]
If somebody’s wondering about the double dot like me: “A common misconception is that number literals cannot be used as objects. That is because a flaw in JavaScript’s parser tries to parse the dot notation on a number as a floating point literal.”
atuladhar
on March 12, 2011
|
prev
[–]
But then, "native prototypes should never be extended unless it is for the sake of compatibility with newer JavaScript features."
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: