Array

        /*
        object类型:
            1,两种访问对象属性的方法
                person.name
                person['name']
                方括号访问的好处在于可以给括号内传递变量
                列:var a = 'name'
                    person[a]
        Array类型:
            length属性:
                这个属性可以再数组末尾添加或删除数组中的元素
                列:
                    colors.length = colors.length - 1 // 删除
                    colors.length = colors.length + 1 // 添加,undefined
                    colors[colors.length] = blue // 添加blue

            检测数组:
                Array.isArray(array) //检测数组array是否为数组
                instanceof    array instanceof Array  // 检测数组,局限性存在于两个不同的执行环境不能检测

            转换方法:(转换为字符串)
                toString()
                join() // 参数为分隔符
            栈,队列方法
                栈:
                 push()
                 pop()
                队列
                 push()
                 shift()

            排序方法:
                sort()
                reverse()
                注意sort()用法
                    var array = [1,5,6,7,6,4,3,7,9]
                    array.sort(function(a,b){
                        return a - b
                        })
                    console.log(array);

            操作方法:
                concat() // 合并数组
                slice() // 返回两个参数之间的元素构成新数组
                splice() // 参数: 起始索引  要删除的元素的个数  要插入任意数量的项
                from() // 赋值数组  参数:要赋值的数组, 用来过滤的函数(可选)
                Array.of() // 根据传入的参数创建一个新数组
                fill()  // 静态值填充数组 参数:要填充的数值 起始索引(可选,不写全部填充) 终止索引(可选,不写默认到最后)
                copyWithin()// 复制数组到当前数组的其它位置 参数:放入位置的索引 复制起始索引 复制结束索引(可选,不写默认到最后)
            位置方法:
                indexOf()
                lastIndexOf() // 参数: 要查找的项  查找起始位置的索引(可选)
                es2015:
                    find()
                    findIndex() // 参数:回调函数     返回一个满足条件的值的索引
                es7:
                    includes() // 检测某个元素是否再数组中

            迭代方法:
                    every()// 每一项都满足条件返回true
                    some() // 有一项满足条件返回true
                    map()  // 返回每一项调用结果组成的数组
                    filter() // 返回满足条件的元素组成的数组
                    forEach() // 每一项运行回调函数,无返回值
                    for...of   // 迭代数组值的循环
            归并方法:
                    reduce()
                    reduceRight()// 从后开始  参数:回调函数  作为归并基础的初始值(可选)
                        注意:回到函数接收四个参数 pre(每次迭代的结果) cur(当前项) index(当前元素索引) array(执行reduce的数组)

         */
原文地址:https://www.cnblogs.com/xu3241/p/13735182.html