check if there is a space string javascript code example
Example: javascript detect space in string
if(str.indexOf(' ') >= 0){
console.log("contains spaces");
}
if(str.indexOf(' ') >= 0){
console.log("contains spaces");
}