Transcript from the "Well Known Symbols" Lesson
[00:00:58] So if I have any object that, for example, is gonna be an iterable, it's gonna be an iterator which we're getting ready to talk about, and I wanna customize the iterator, the location on the object to do that at is at symbol.iterator. If I wanna hook to customize how a thing is stringified whenever you call toString on it, I customize that at the hook location toStringTag.
[00:01:24] If I want to control whether or not an object should be spread if it's passed to the Concat method, I control that with isConcatSpreadable, okay? Are you following me? These are meta extension hooks. That's what they really are. Okay. So these are just built in ones. So if we come over here to the browser, and we ask what is in Symbol.iterator, see they predefined one for us.
[00:01:51] We don't know what its value is, but it doesn't matter because that's the special value, it's a special constant, if you will, that we can use to do a meta extension. Symbol.isConcatSpreadable. Oops. Symbol. What are the other ones? isPrototype. No that's not one. toPrimitive is one, unscopeable is one.
[00:02:24] There's a bunch of them, okay. Like I said there's about a dozen of them. I'm not going to cover any of these well known symbols in any kind of detail. They're covered in exquisite detail in my ES6 book. But we want to zero in our attention for the rest of today on iterators.
[00:02:40] That's the whole reason I talked to you about symbols, is so you know what symbol.iterator is. Okay?