4 ms·
For anyone wondering why this is, it's because parseInt takes two arguments "string" and "radix". Map calls a function with "currentValue", "index", and "array
by andyfleming 9y ago
For anyone wondering why this is, it's because parseInt takes two arguments "string" and "radix".
Map calls a function with "currentValue", "index", and "array".
So the calls essentially look like this:
parseInt("1", 0, arrayReference) // => 1
parseInt("2", 1, arrayReference) // => NaN
parseInt("3", 2, arrayReference) // => NaN