js check if string has value code example
Example 1: check for substring javascript
const string = "javascript";
const substring = "script";
console.log(string.includes(substring)); //true
Example 2: javascript if string empty
// Test whether strValue is empty or is None
if (strValue) {
//do something
}
// Test wheter strValue is empty, but not None
if (strValue === "") {
//do something
}