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
You can use lodash: _.isEmpty(value).
It covers a lot of cases like {}, '', null, undefined, etc.
{}
''
null
undefined
But it always returns true for Number type of JavaScript primitive data types like _.isEmpty(10) or _.isEmpty(Number.MAX_VALUE) both returns true.
true
Number
_.isEmpty(10)
_.isEmpty(Number.MAX_VALUE)