Mimicking sets in JavaScript?

前端 未结 7 2054
栀梦
栀梦 2020-11-22 13:01

I\'m working in JavaScript. I\'d like to store a list of unique, unordered string values, with the following properties:

  1. a fast way to ask \'is A in t
7条回答
  •  遇见更好的自我
    2020-11-22 13:31

    I have started an implementation of Sets that currently works pretty well with numbers and strings. My main focus was the difference operation, so I tried to make it as efficient as I could. Forks and code reviews are welcome!

    https://github.com/mcrisc/SetJS

提交回复
热议问题