Lodash 中的 forEach 函数
var array = ["a", "b", "c", "d"]; _.forEach(array, function (item) { if (item == "a") { return true; // continue } else if (item == "d") { return false; // break } print(item); });
输出:
b c
Lodash 中的 forEach 函数
var array = ["a", "b", "c", "d"]; _.forEach(array, function (item) { if (item == "a") { return true; // continue } else if (item == "d") { return false; // break } print(item); });
输出:
b c
三味线
不吃咸鱼的喵
文章评论