Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Example of ES6 Spread Operator - String Splitting
/* ES5 */
var lol = "cats";
var chars = lol.split("");
// > [ "c", "a", "t", "s" ]
/* >= ES6 */
var lol = "cats";
var chars = [ ...cats ];
// > [ "c", "a", "t", "s" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment