1.1.7 • Published 1 year ago
hs-node-lib v1.1.7
hs-node-lib
array.service.js
dynamicArraySort
Sorts an array by property:
eventsToday.sort(dynamicArraySort("end"))
useFirstArrayRowAsKeys
Use incoming first col as header.
getRandomArrayEntry
Returns a random array entry.
asyncForEach
You can pass an array as first and the async callback as second argument:
const asyncForEach = require('@johoehn/async-foreach');
const arrayItems = [1,2,3];
(async() => {
await asyncForEach(arrayItems, async (arrayItem) => {
//await request
console.log(arrayItem);
});
})();