freeCodeCamp Challenge Guide: Split Strings with Split

freeCodeCamp Challenge Guide: Split Strings with Split
0

#1

You can use the .split() method to split a string into an array.

split uses the argument you give to to split the string.

array = string.split(' ');

#2

Hey campers,here is how I approached the challenge:

var string = “Split me into an array”;
var array = [];

// Only change code below this line.

array = string.split(/\s+/g);