I saw this question, but I didn\'t see a JavaScript specific example. Is there a simple string.Empty available in JavaScript, or is it just a case of checking f
string.Empty
There's no isEmpty() method, you have to check for the type and the length:
isEmpty()
if (typeof test === 'string' && test.length === 0){ ...
The type check is needed in order to avoid runtime errors when test is undefined or null.
test
undefined
null