@yomguithereal/helpers
v1.1.1
Published
Miscellaneous helper functions.
Downloads
229,692
Readme
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]