generate functionThu, 01 Dec 2022
each
function each(list, callback) { for (let i = 0; i < list.length; i++) { callback(list[i], i, list); } } each([1,2,3], (item, index, array) => console.log(item, index, array)) // 1 0 [1, 2, 3] 2 1 [1, 2, 3] 3 2 [1, 2, 3]
Javascript
Generate More