-
Notifications
You must be signed in to change notification settings - Fork 1
set
Subhajit Sahu edited this page Feb 3, 2021
·
24 revisions
Set value at index.
function set(x, i, v)
// x: an iterable
// i: index
// v: value
const xiterable = require('extra-iterable');
var x = [2, 4, 6, 8];
[...xiterable.set(x, 1, 40)];
// → [2, 40, 6, 8]
[...xiterable.set(x, 3, 80)];
// → [2, 4, 6, 80]