`new Set(123)` and `for(const x of 123);` both throw errors because they expect iterables, but the errors they throw are very different and not very informative. In the spec these errors are generated when step if https://tc39.github.io/ecma262/#sec-set-iterable is run on a value that does not have an iterator property. Currently firefox generates error messages that look like: `TypeError: 123 is not iterable` for both of the above cases, which is very intuitive and actionable. Chrome handles the for-of case the same way, but generates an `undefined is not a function` error for the Set case. I have filed an issue to make this behavior consistent (https://bugs.chromium.org/p/chromium/issues/detail?id=809214). In Safari the Set constructor example generates a TypeError with no message, and the for-of loop generates an `undefined is not a function` error. Ideally the behavior for these 2 examples would be consistent.