js find out if in string is a space code example Example: js find space in string if(str.indexOf(' ') >= 0){ console.log("contains spaces"); }