字符串转换成数字或者把数字转换成字符串
var arr = [1, 2, 3, 4, 5, 6, 7, 8, 9]; arr.map(String); //结果: ['1', '2', '3', '4', '5', '6', '7', '8', '9']
var a = ['1', '2', '3', '4', '5', '6', '7', '8', '9'] a.map(Number); //结果:[1, 2, 3, 4, 5, 6, 7, 8, 9]
合作联系微信: w6668263 合作联系电话:177-9238-7426
var arr = [1, 2, 3, 4, 5, 6, 7, 8, 9]; arr.map(String); //结果: ['1', '2', '3', '4', '5', '6', '7', '8', '9']
var a = ['1', '2', '3', '4', '5', '6', '7', '8', '9'] a.map(Number); //结果:[1, 2, 3, 4, 5, 6, 7, 8, 9]