remove - nodef/extra-lists GitHub Wiki

Remove value at key.

Similar: get, set, remove.

function remove(x, k)
// x: lists
// k: key
const xlists = require('extra-lists');

var x = ['a', 'b', 'c', 'd'], [2, 4, 6, 8](/nodef/extra-lists/wiki/'a',-'b',-'c',-'d'],-[2,-4,-6,-8);
xlists.remove(x, 'b');
// → [ [ 'a', 'c', 'd' ], [ 2, 6, 8 ] ]

xlists.remove(x, 'd');
// → [ [ 'a', 'b', 'c' ], [ 2, 4, 6 ] ]

References