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