摘要:
Javascript 闭包 var add = (function () { var counter = 0; return function () {return counter += 1;} })(); add() add() add() counter值为3 正常局部变量活得不长。它们在函数调 阅读全文
摘要:
数组方法遍历回调的参数: 项目值 项目索引 数组本身 1、Array.forEach() forEach() 方法为每个数组元素调用一次函数(回调函数)。 遍历数组、不改变原数组、返回undefined. (value, index, array) value: 遍历的当前值 index: 遍历的当 阅读全文