let str = " ";
if (!str.replace(/s/g, "").length) {
console.log("string only contains whitespace (ie. spaces, tabs or line breaks)");
}
Code Example |
---|
Javascript :: remove element by class |
Javascript :: |
Javascript :: |
:: loop through key value pairs js |
:: |
Javascript :: set width screen angular |
:: nodejs command line arguments |
:: |
:: node format variable in string |
Javascript :: jquery continue in loop each |
Javascript :: |
Javascript :: html string to html |
:: |
:: |
:: |
:: |
Javascript :: javascript detect dark mode |
Javascript :: |
Javascript :: javascript remove space from two side of string |
:: jimp get image size |
:: |
:: |
Javascript :: select all children javascript |
:: |
Javascript :: |
Javascript :: change onclick attribute with javascrip |
Javascript :: |
:: |
:: |
:: how to use session using javascript |