Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Okay but the whole article could have been summed up in 4 sentences:

> Looking at the specification of parseInt you should notice that it is defined as accepting two arguments. The first argument is the string to be parsed and the second specifics the radix of the number to be parsed. >...the function that is passed as the first argument to map as the callbackfn. The specification says, “the callbackfn is called with three arguments: the value of the element, the index of the element, and the object that is being traversed.”



I read your comment, didn't understand your explanation. Then I read the article and understood. I liked the slower break down in the article.


One paragraph would have been enough, for me, it dragged on and I started skipping sections of text. I am amazed someone wanted to spend their precious hours writing such a long article for something that could have been much less. Different strokes and folks though.


Or two:

> Array.prototype.map passes the element's index as the second argument to the callback, and parseInt accepts an optional second argument as the radix (base).

> Using the index as the radix yields a nonsensical result.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: