@extra-map/shift-update

Removes first entry. :package: :smiley_cat: :running: :vhs: :moon: :scroll: :newspaper: :blue_book:

Usage no npm install needed!

<script type="module">
  import extraMapShiftUpdate from 'https://cdn.skypack.dev/@extra-map/shift-update';
</script>

README

Removes first entry. :package: :smiley_cat: :running: :vhs: :moon: :scroll: :newspaper: :blue_book:

Alternatives: shift, shift$.

This is part of package extra-map.


map.shift$(x);
// x: a map (updated)
// → x
const map = require("extra-map");

var x = new Map([["a", 1], ["b", 2], ["c", 3]]);
map.shift$(x);
// Map(2) { "b" => 2, "c" => 3 }

x;
// Map(2) { "b" => 2, "c" => 3 }

map.shift$(x);
// Map(1) { "c" => 3 }


References