Neil Patrick's Mansion

    @extra-map/set
    TypeScript icon, indicating that this package has built-in type declarations

    2.2.15 • Public • Published

    Sets value at key. 📦 😺 🏃 📼 🌔 📜 📰 📘

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

    This is part of package extra-map.


    map.set(x, k, v);
    // x: a map
    // k: key
    // v: value
    const map = require("extra-map");
    
    var x = new Map([["a", 2], ["b", 4], ["c", 6], ["d", 8]]);
    map.set(x, "b", 40);
    // Map(4) { "a" => 2, "b" => 40, "c" => 6, "d" => 8 }
    
    map.set(x, "d", 80);
    // Map(4) { "a" => 2, "b" => 4, "c" => 6, "d" => 80 }


    References

    Keywords

    Install

    npm i @extra-map/set

    DownloadsWeekly Downloads

    103

    Version

    2.2.15

    License

    MIT

    Unpacked Size

    3.79 kB

    Total Files

    7

    Last publish

    Collaborators

    • wolfram77