regex for check if string is only empty or whitespace javascript
//empty string or white space
function hasWhiteSpace(value) {
return /^s*$/.test(value);
}
// empty string or string with white space
function hasWhiteSpace(value) {
return /^$|s+/.test(value);
}