is string undefined null or empty c 23 javascript

Solutions on MaxInterview for is string undefined null or empty c 23 javascript by the best coders in the world

showing results for - "is string undefined null or empty c 23 javascript"
Alejandra
15 Oct 2016
1/**
2  * Checks the string if undefined, null, not typeof string, empty or space(s)
3  * @param {any} str string to be evaluated
4  * @returns {boolean} the evaluated result
5*/
6function isStringNullOrWhiteSpace(str) {
7    return str === undefined || str === null
8                             || typeof str !== 'string'
9                             || str.match(/^ *$/) !== null;
10}