Closed johnaweiss closed 4 years ago
In any environment where for..of
respects a native Symbol.iterator
(or similar), this shim will cover it.
There may be an environment or three where for..of
only works on, for example, Maps and Sets, and there's no native Symbols - but it's impossible to do anything about those.
Do you have specific environments in mind?
In any environment where for..of respects a native Symbol.iterator (or similar), this shim will cover it.
Would that include the example code in my question?
Do you have specific environments in mind?
just general cross-browser web-development.
Yes, that would include that code.
I'm pretty confident you'll be fine; please file an issue with specific details if you find a browser where it doesn't work. (of course, you should be using babel to transpile, which will handle for..of
syntax properly)
for example
for(var c of "tree 木") { console.log(c); }
Thanks