-
Notifications
You must be signed in to change notification settings - Fork 1
remove
Subhajit Sahu edited this page Jun 15, 2020
·
10 revisions
Removes value at index. 🏃 📼 📦 🌔 📒
iterable.remove(x, i);
// x: an iterable
// i: index
const iterable = require('extra-iterable');
var x = [1, 2, 3, 4, 5];
[...iterable.splice(x, 2)];
// [ 1, 2 ]
[...iterable.splice(x, 2, 2)];
// [ 1, 2, 5 ]
[...iterable.splice(x, 2, 2, 30, 40)];
// [ 1, 2, 30, 40, 5 ]