Skip to content
Subhajit Sahu edited this page Dec 28, 2022 · 16 revisions

Set value at key.

Similar: get, set, remove.


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 ] ]


References

Clone this wiki locally