📅  最后修改于: 2022-03-11 15:03:22.044000             🧑  作者: Mango
var containsWhitespace = function(str){
return /\s/g.test(s);
};
console.log(containsSpaces("foo bar"));//Returns true
console.log(containsSpaces("foobar"));//Returns false