@extra-iterable/set.min

Sets value at index. :package: :smiley_cat: :running: :vhs: :moon: :scroll: :newspaper: :blue_book:

Usage no npm install needed!

<script type="module">
  import extraIterableSetMin from 'https://cdn.skypack.dev/@extra-iterable/set.min';
</script>

README

Sets value at index. :package: :smiley_cat: :running: :vhs: :moon: :scroll: :newspaper: :blue_book:

Similar: get, set, remove.

This is part of package extra-iterable.

This is browserified, minified version of @extra-iterable/set.
It is exported as global variable iterable_set.
CDN: unpkg, jsDelivr.


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

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

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


References