['1','2','3'].map(parseInt)

1.['1','2','3'].map(parseInt)
//(3) [1, NaN, NaN]

2.['10','10','10','10','30','10','40','60',].map(parseInt)
 [10, NaN, NaN, 3, 4, 5, 18, 7, 32, 54]


解析:
['1','2','3'].map((item, index) =>{
      return parseInt(item,  index)
  })
parseInt('1', 0)  //1
parseInt('2', 1)  //NaN
parseInt('3', 2)  //NaN  3不是二进制


同理:
2.['10','10','10','10','30','10','40','60',].map(parseInt)
 [10, NaN, 2, 3, 12, 5, 24, 42]

parseInt('10', 0)  //10
parseInt('10', 1)  //NaN
parseInt('10', 2)  //2
parseInt('10', 3)  //3
parseInt('30', 4)  //12 ===> 3* 4(一次方)
parseInt('10', 5)  //5
parseInt('40', 6)  //24===> 4* 6(一次方)
parseInt('60', 7)  //==42=> 6* 7(一次方)

你可能感兴趣的:(['1','2','3'].map(parseInt))