search

Home  >  Q&A  >  body text

javascript - What is the role of weak set in ES6?

Weak set is not iterable, you cannot use for-of, keys(), values(), forEach() to traverse values

So what is its function? Is it just about storing objects?

某草草某草草2806 days ago569

reply all(1)I'll reply

  • 迷茫

    迷茫2017-05-19 10:45:42

    The performance of set is higher than that of map. Its value is reflected when you need to store non-duplicate data and you don’t care about the order of data!

    reply
    0
  • Cancelreply