Array.length
const arr = ['a', 'b', 'c']
console.log(arr.length)
concat()
// 合并两个或多个数组 创建新数组
const arr1 = ['a', 'b', 'c']
const arr2 = ['d', 'e', 'f']
const arr3 = arr1.concat(arr2)
console.log(arr3) // ['a', 'b', 'c', 'd', 'e', 'f']
filter()
const words = ['spray', 'limit', 'elite', 'exuberant', 'destruction', 'present']
const result = words.filter(res=> res.length > 6)
console.log(result)
find()
const array1 = [5, 12, 8, 130, 44]
const found = array1.find(res => res > 10)console.log(found)
findIndex()
const array1 = [5, 12, 8, 130, 44]
const found = array1.findIndex(res => res > 13)
console.log(found)
forEach()
const array1 = ['a', 'b', 'c']
array1.forEach(res=> console.log(res))
map()
const array1 = [1, 4, 9, 16]
const map1 = array1.map(x => x * 2)
console.log(map1)
reduce(callback, initialValue)
const array1 = [1, 2, 3, 4]
const total = array1.reduce((a, b)=>{ return a + b })
console.log(total)
sort()
const array1 = [1, 30, 4, 21, 100000]
array1.sort()
console.log(array1)
slice(start, end)
const data = ['a', 'b', 'c']
console.log(data.slice(0, 1))