The meaning of “'x' is not a function or its return value is not iterable” error
问题 I accidentally witnessed that this causes an error in V8 (Chrome, Node.js, etc): for (let val of Symbol()) { /*...*/ } TypeError: Symbol is not a function or its return value is not iterable It appears that any other non-iterable value (including a function) causes another error: for (let val of function () { throw 'never called' }) { /*...*/ } TypeError: (intermediate value) is not iterable As the reference states, the error is specific to Chrome: TypeError: 'x' is not a function or its