标签:array ret 传递 ack com radix iso 进制 log
let data = [3,4,2]; let data2 = data.map(item=>{ return item*5 })
console.log(data2)
let users = [ {name: "天海佑希", "email": "zhang@email.com"}, {name: "麻乃佳世", "email": "jiang@email.com"}, {name: "天上欧蒂娜", "email": "li@email.com"} ]; let emails = users.map(item=>item.email)
let data3 = data.map(parseInt) console.log(data3) //[3,NaN,NaN]
//所以这里parseInt函数应该是parseInt(‘3‘,0,data),parseInt(‘4‘,0,data),parseInt(‘2‘,0,data)
//而parseInt函数接收两个参数(string,radix) parseInt函数根据指定的基数radix生成一个整数值,radix通常是10进制
标签:array ret 传递 ack com radix iso 进制 log
原文地址:https://www.cnblogs.com/feijiediyimei/p/10795221.html