Skip to content
Subhajit Sahu edited this page Jun 20, 2020 · 27 revisions

Sets value at index. 🏃 📼 📦 🌔 📒

Alternatives: set, set$.
Similar: get, set, remove.

array.set$(x, i, v);
// x: an array (updated)
// i: index
// v: value
// --> x
const array = require('extra-array');

var x = [2, 4, 6, 8];
array.set$(x, 1, 40);
// [ 2, 40, 6, 8 ]

x;
// [ 2, 40, 6, 8 ]

var x = [2, 4, 6, 8];
array.set$(x, 3, 80);
// [ 2, 4, 6, 80 ]

references

Clone this wiki locally