-
Notifications
You must be signed in to change notification settings - Fork 3
set$
Subhajit Sahu edited this page Jun 12, 2020
·
12 revisions
Alternatives: [set], [set$].
Similar: [get], [set], [remove].
array.set(x, i, v);
// x: an array
// i: index
// v: value
const object = require('extra-object');
var x = {a: 2, b: 4, c: 6, d: 8};
object.set$(x, 'b', 40);
// { a: 2, b: 40, c: 6, d: 8 }
x;
// { a: 2, b: 40, c: 6, d: 8 }
var x = {a: 2, b: 4, c: 6, d: 8};
object.set$(x, 'd', 80);
// { a: 2, b: 4, c: 6, d: 80 }