-
Notifications
You must be signed in to change notification settings - Fork 0
set
Subhajit Sahu edited this page Jun 17, 2020
·
14 revisions
Sets value at key. 🏃 [:vhs:] 📦 🌔 📒
entries.set(x, k, v);
// x: entries
// k: key
// v: value
const entries = require('extra-entries');
var x = [['a', 2], ['b', 4], ['c', 6], ['d', 8]];
[...entries.set(x, 'b', 40)];
// [ [ 'a', 2 ], [ 'b', 40 ], [ 'c', 6 ], [ 'd', 8 ] ]
[...entries.set(x, 'd', 80)];
// [ [ 'a', 2 ], [ 'b', 4 ], [ 'c', 6 ], [ 'd', 80 ] ]