JSPM

@extra-array/set

2.9.63
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 207
  • Score
    100M100P100Q83225F
  • License MIT

Sets value at index.

Package Exports

  • @extra-array/set

Readme

Sets value at index. 🏃 📼 📦 🌔 📒

Alternatives: set, set$.
Similar: get, set, remove.
This is part of package extra-array.

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

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

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

references