HEAD
Write a function to split a string and convert it into an array of words.
* "Robin Singh" ==> ["Robin", "Singh"] * "I love arrays they are my favorite" ==> ["I", "love", "arrays", "they", "are", "my", "favorite"]
function stringToArray(string){
return string.split(' ')}
Try it yourself - CodeWars
Write a function to split a string and convert it into an array of words.
* "Robin Singh" ==> ["Robin", "Singh"] * "I love arrays they are my favorite" ==> ["I", "love", "arrays", "they", "are", "my", "favorite"]
function stringToArray(string){
return string.split(' ')}
Try it yourself - CodeWars