數組裏的字符串轉爲數字

['1','2','3'].map(function(item) {

  return +item;

});

//[1,2,3]

  或者javascript

["1", "2"].map(Number)
相關文章
相關標籤/搜索