Python like utility functions for JS
npm install pythonic --savekeyValues
import {keyValues} from 'pythonic';
const obj = {a: 'aa', b: 'bb'};
for (const [key, value] of keyValues(obj))
console.log(`key: ${key}, value: ${value}`);
// key: a, value: aa
// key: b, value: bbenumerate
import {enumerate} from 'pythonic';
const arr = ['a', 'b'];
for (const [index, value] of enumerate(arr))
console.log(`index: ${index}, value: ${value}`);
// index: 0, value: a
// index: 1, value: bzip
import {zip} from 'pythonic';
const arr1 = ['a', 'b'];
const arr2 = ['c', 'd', 'e'];
for (const [first, second] of zip(arr1, arr2))
console.log(`first: ${first}, second: ${second}`);
// first: a, second: c
// first: b, second: d