I tested the spread operator at CODEPEN and chrome and I got different result
var str = 'foo';
var char = [...str];
["f", "o", "o"]
As mentioned in the comment, this is related to babel js transpiler.
Looks like codepen is using this babel-preset
es2015-loose and it has some divergences in its spread operator implementation:
Babel’s loose mode transpiles ES6 code to ES5 code that is less faithful to ES6 semantics.
This is actually a codepen issue, they probably shouldn't be using
loose mode these days.