求最大值
var arr = [1, 2, 3, 4, 5]
let res = Math.max(...arr)
console.log(res)//5
求平方
var arr = [1, 2, 3, 4, 5]
let res = arr.map((x) =>{
return Math.pow(x,2)
})
console,log(res)
求最大值
var arr = [1, 2, 3, 4, 5]
let res = Math.max(...arr)
console.log(res)//5
求平方
var arr = [1, 2, 3, 4, 5]
let res = arr.map((x) =>{
return Math.pow(x,2)
})
console,log(res)