1.0.7 • Published 5 years ago
each-recursive v1.0.7
each-recursive
replace foreach with recursion
Install
npm i -s each-recursive
Import
import eachRecursive from "each-recursive";
Use
eachRecursive(["thanks", "all"], (item, index) => console.log(item, index));
// thanks 0, all 1
eachRecursive({ a: 1, b: 2, c: 3 }, (key, value) => console.log(key, value));
// a 1, b 2, c 3