Immutable-js set example

node v8.17.0
version: 1.0.0
endpointsharetweet
im = require("immutable") const mySet = im.Set([1, "a", {value: Symbol()}]) // the .add and .delete methods do not modify mySet, but return a new set instance instead. const newSet = mySet .add(42) .delete(1) console.info("Does mySet have 42?", mySet.has(42)) console.info("Does newSet have 42?", newSet.has(42))
Loading…

no comments

    sign in to comment