Split a string into an array

str = "Hey please separate this sentence after each space and put the words into an array!";
var words = str.split(" ");
console.log(words[0]); //-> "hey"

Add your comment