-
Behrisch, M. (Michael) authored
Several (potentially even external) libraries might want to use our mock data and some utils. I pulled them out into a lib with a package.json
Behrisch, M. (Michael) authoredSeveral (potentially even external) libraries might want to use our mock data and some utils. I pulled them out into a lib with a package.json
README.md 652 B
Yomguithereal's helpers
Miscellaneous helper functions.
Installation
npm install @yomguithereal/helpers
Usage
#.extend
Pushes multiple values to the given array.
It is faster than doing array.push.apply(array, values)
and works by first mutating the array's length and then setting the new indices (benchmark proved it is faster than a loop of pushes).
import extend from '@yomguithereal/helpers/extend';
const a = [1, 2, 3];
extend(a, [4, 5, 6]);
a
>>> [1, 2, 3, 4, 5, 6]