-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
[1,2,3].map(parseInt)
关键点是对parseInt的掌握
parseInt(string, radix) 第一个参数为被解析的值,第二个为进制,默认为10
同时map(callback(currentValue, index, array), this)
很显然,在[1,2,3].map(parseInt)中parseInt接受到的参数是currentValue, index,对于parseInt接受到的第二参数radix而言,是有一定范围的[2,36]和特殊值0

传送门
所以最后的结果是返回[1, NaN, NaN]
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels