![]() ![]() ![]() let pets = new Set() Ĭonsole.log(pet) // "Cat", "Dog", "Hamster" ![]() Objects like Map and Set implement erator property allowingĪccess to stored values. Hand, is mainly interested in values of iterable objects. Here is an example that demonstrates this distinction: let list = Īnother distinction is that for.in operates on any object it servesĪs a way to inspect properties on this object. Of the numeric properties of the object being iterated. The object being iterated, whereas for.of returns a list of values Iterated on are different though, for.in returns a list of keys on I found a complete answer at Iterators and Generators (Although it is for TypeScript, this is the same for JavaScript too)īoth for.of and for.in statements iterate over lists the values ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |