Skip to content
wolfram77 edited this page Mar 19, 2020 · 26 revisions

Sets value at index (+ve, -ve).

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

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

array.set(x, -1, -8);
// [2, 4, 6, -8]

references

Clone this wiki locally