Why does spread operator at CodePen and Chrome have different results?

Viewed 226

I tested the spread operator at CodePen and in Chrome and I got different result.

var str = 'foo';
var char = [...str];
console.log(char);

At CodePen I used the Babel preprocessor and got ["foo"].

In Chrome developer tools, I got ["f", "o", "o"].

Why does this happen?

2 Answers
Related