1 // Remove item(s) in array (if present)
2 export function remove(array
, rfun
, all
)
4 const index
= array
.findIndex(rfun
);
7 array
.splice(index
, 1);
10 // Reverse loop because of the splice below
11 for (let i
=array
.length
-1; i
>=index
; i
--)
20 // Double array intialization
21 export function init(size1
, size2
, initElem
)
23 return [...Array(size1
)].map(e
=> Array(size2
).fill(initElem
));
26 export function range(max
)
28 return [...Array(max
).keys()];