remove: function(arr, rfun, all) {
const index = arr.findIndex(rfun);
if (index >= 0) {
arr.splice(index, 1);
remove: function(arr, rfun, all) {
const index = arr.findIndex(rfun);
if (index >= 0) {
arr.splice(index, 1);
// Reverse loop because of the splice below
for (let i = arr.length - 1; i >= index; i--) {
if (rfun(arr[i])) arr.splice(i, 1);
// Reverse loop because of the splice below
for (let i = arr.length - 1; i >= index; i--) {
if (rfun(arr[i])) arr.splice(i, 1);