TypeScript has some built in types like Array, String, Int32Array, Uint32Array, etc. support iteration because they have implemented Symbol.iterator property. In order to perform iteration on custom object, object must implement Symbol.Iterator property.
The for..of loop work with iterable object like array by invoking Symbol.Iterator property and return value of iterable objects. For Example:
The for..of loop work with any iterable object and return key of iterable objects. For Example: