js 数组、字符串的基础操作

ES5数组的基础操作 1. indexOf(索引) 给一个值 返回该值的索引 没有返回-1 2. forEach(function(item,index,arr){}) forEach遍历数组 有多少项遍历多少次 对原数组进行操作 3. map 功能同forEach 但是返回的是新数组 4. filter() 遍历数组 对每一项进行筛选 arr.filter(function(item,index
相关文章
相关标签/搜索