JavaScript 编码技巧
1. JavaScript 字符串数组转换
const numArray = [1, 2, 3, 4, 5]
const strArray = numArray.map(String)
console.log(strArray) // ["1", "2", "3", "4", "5"]
数组map语法:array.map(function(currentValue,index,arr), thisValue)
2022-05-26 04:41:53
1. JavaScript 字符串数组转换
const numArray = [1, 2, 3, 4, 5]
const strArray = numArray.map(String)
console.log(strArray) // ["1", "2", "3", "4", "5"]
数组map语法:array.map(function(currentValue,index,arr), thisValue)