X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Futils%2Farray.js;h=3d7f7ae4260c1852b6d8691082ce637813402c63;hb=7a0c1b7e33a346195caebfdfa6489e7c6d0457e6;hp=d02552c10ec471a8cffe9e537f9736b0392014b9;hpb=6e0f28425075e6d2d79cab6d30bca6ce6d55f19d;p=vchess.git diff --git a/client/src/utils/array.js b/client/src/utils/array.js index d02552c1..3d7f7ae4 100644 --- a/client/src/utils/array.js +++ b/client/src/utils/array.js @@ -1,5 +1,6 @@ // Remove item(s) in array (if present) export const ArrayFun = { + remove: function(arr, rfun, all) { const index = arr.findIndex(rfun); if (index >= 0) { @@ -21,4 +22,5 @@ export const ArrayFun = { range: function(max) { return [...Array(max).keys()]; } + };