What is actually @@iterator. Is this a symbol literal or something? I see it mentioned in many tutorials but no one seems to explain what kind of animal it is really.
-
Might also be of use: stackoverflow.com/questions/29492333/…Nick Parsons– Nick Parsons2019-12-29 14:54:46 +00:00Commented Dec 29, 2019 at 14:54
-
Thanks but I am still confused, so it is not part of the Javascript Syntax but they still use it widely to refer to the Symbol.iterator symbol constant?! Is that right?peter.petrov– peter.petrov2019-12-29 15:00:52 +00:00Commented Dec 29, 2019 at 15:00
-
2yes, the @@ isn’t part of the JS syntax, it’s more just a notation used by the spec “within this specification a well-known symbol is referred to by using a notation of the form @@name” - ecma-international.org/ecma-262/6.0/#sec-well-known-symbolsNick Parsons– Nick Parsons2019-12-29 15:06:59 +00:00Commented Dec 29, 2019 at 15:06
Add a comment
|
1 Answer
It's Symbol.iterator, a well-known symbol.
The @@ naming is a convention used in the javascript language specification: http://www.ecma-international.org/ecma-262/6.0/#sec-well-known-symbols
2 Comments
peter.petrov
But @@ is this part of the Javascript Syntax at all?
Axnyff
Edited my answer it's just a convention