标签:
JS:
function span(arr, predicate) { for (var i = 0; i < arr.length; i++) { if (!predicate(arr[i])) break; } return [ arr.slice(0, i), arr.slice(i) ] } /* 1,遍历数组内数据是否符合后面函数; 2,arr.slice(first,end); */
标签:
原文地址:http://www.cnblogs.com/gobacktomars/p/4882557.html