JavaScript array


参考
http://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array

Array.from()

Array.isArray()

Array.of()

Array.prototype.concat()

Array.prototype.copyWithin()

Array.prototype.entries()

Array.prototype.every()

Array.prototype.fill()

Array.prototype.push()

Array.prototype.pop()

Array.prototype.shift()

Array.prototype.unshift()

Array.prototype.splice()

Array.prototype.split()

Array.prototype.sort()

Array.prototype.reverse()

Array.prototype.slice()

Array.prototype.forEach()

Array.prototype.map()

语法

var newArray = arr.map(callback(element[, index[, array]])[, thisArg])

示例

1
2
3
4
var filtered = [1, 4, 9, 16].map(element => {
return element * 2
})
→ [2, 8, 18, 32]

Array.prototype.filter()

语法

var newArray = arr.filter(callback(element[, index[, array]])[, thisArg])

示例

1
2
3
4
var filtered = [12, 5, 8, 130, 44].filter(element => {
return element >= 10
})
→ [12, 130, 44]

Array.prototype.come()

Array.prototype.reduce()

Array.prototype.reduceRight()

Array.prototype.indexOf()

Array.prototype.lastIndexOf()

Array.prototype.find()

Array.prototype.findIndex()

Array.prototype.includes()

Array.prototype.keys()

Array.prototype.values()

广东韩江司法鉴定所 - 网站设计 Nginx 均衡负载视频教程
Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×