A very simple check that you can do:
Explanation 1:
if (value) {
// it will come inside
// If value is either undefined, null or ''(empty string)
}
Explanation 2:
(!value) ? "Case 1" : "Case 2"
If the value is either undefined , null or '' then Case 1
otherwise for any other value of value Case 2.