Hi I was working on some project and had an issue with the spread operator on strings.
How to replicate:
- Go to JSFiddle
- Select TypeScript
- Remove the default code in the TypeScript panel
- Paste this TypeScript code
let chars = [...'hello'];
console.log(chars);
After clicking run, it shows in the console (on my end):
"[Line 15] Uncaught TypeError: Cannot use 'in' operator to search for '0' in hello"
Here's a screenshot:

Here's also the link to the JSFIddle.
I'm using .split('') in the meantime.
Hi I was working on some project and had an issue with the spread operator on strings.
How to replicate:
After clicking run, it shows in the console (on my end):
Here's a screenshot:

Here's also the link to the JSFIddle.
I'm using
.split('')in the meantime.