摘要: filter(): 语法:var filteredArray = array.filter(callback[, thisObject]);参数说明:callback:要对每个数组元素执行的回调函数。thisObject :在执行回调函数时定义的this对象。//过滤掉小于 10 的数组元素://代码:function isBigEnough(element, index, array) { return (element >= 10);}var filtered = [12, 5, 8, 130, 44].filter(isBigEnough);// 12, 130, 44//结果:[ 阅读全文
posted @ 2013-07-16 19:07 xiaohong_oath 阅读(124626) 评论(4) 推荐(12) 编辑