1 // Remove item(s) in array (if present)
2 export const ArrayFun
=
4 remove: function(arr
, rfun
, all
)
6 const index
= arr
.findIndex(rfun
);
12 // Reverse loop because of the splice below
13 for (let i
=arr
.length
-1; i
>=index
; i
--)
22 // Double array intialization
23 init: function(size1
, size2
, initElem
)
25 return [...Array(size1
)].map(e
=> Array(size2
).fill(initElem
));
30 return [...Array(max
).keys()];