3 ms·
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 accepti
by seiferteric 3y ago
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.”
- yieldcrv 3y ago[flagged]
- 4pkjai 3y agoI read your comment, didn't understand your explanation. Then I read the article and understood. I liked the slower break down in the article.
- pleb_nz 3y agoOne 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.
- paulddraper 3y agoOr 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.