Is there a library for a Set data type in Javascript?

前端 未结 6 1526
迷失自我
迷失自我 2020-12-09 09:28

Since Javascript doesn\'t have a built in set datatype has anyone come across a decent library for sets and set operations like union, intersection, etc?

6条回答
  •  感情败类
    2020-12-09 10:23

    Have a look at JS.Set.

    The JS.Set class can be used to model collections of unique objects. A set makes sure that there are no duplicates among its members, and it allows you to use custom equality methods for comparison as well as JavaScript’s === operator.

    It contains methods like union, intersection, merge, etc ...

提交回复
热议问题