Skip to content

remove$

Subhajit Sahu edited this page Feb 3, 2021 · 14 revisions

Deletes an entry. 🏃 📼 📦 🌔 📒

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


map.remove$(x, k);
// x: a map (updated)
// k: key
// --> x
const map = require("extra-map");

var x = new Map([["a", 2], ["b", 4], ["c", 6], ["d", 8]]);
map.remove$(x, "b");
// Map(3) { "a" => 2, "c" => 6, "d" => 8 }

x;
// Map(3) { "a" => 2, "c" => 6, "d" => 8 }

var x = new Map([["a", 2], ["b", 4], ["c", 6], ["d", 8]]);
map.remove$(x, "d");
// Map(3) { "a" => 2, "b" => 4, "c" => 6 }


References

Clone this wiki locally