-
Notifications
You must be signed in to change notification settings - Fork 0
set
Subhajit Sahu edited this page Dec 22, 2022
·
14 revisions
Set value at key.
function set(x, k, v)
// x: ientries
// k: key
// v: value
const ientries = require('extra-ientries');
var x = [["a", 2], ["b", 4], ["c", 6], ["d", 8]];
[...ientries.set(x, "b", 40)];
// → [ [ "a", 2 ], [ "b", 40 ], [ "c", 6 ], [ "d", 8 ] ]
[...ientries.set(x, "d", 80)];
// → [ [ "a", 2 ], [ "b", 4 ], [ "c", 6 ], [ "d", 80 ] ]