Split par JavaScript Whitespace
var text = "hoi how are you";
var arr = text.split(/\s+/);
Tough Tarsier
var text = "hoi how are you";
var arr = text.split(/\s+/);
// find words separated by whitespace in a string js
var text = "hoi how are you";
var arr = text.split(/\s+/)
var containsWhitespace = function(str){
return /\s/g.test(s);
};
console.log(containsSpaces("foo bar"));//Returns true
console.log(containsSpaces("foobar"));//Returns false