How to you check for undefined?
If it ’s just a Boolean check then you don ’t even need to compare to anything since undefined is a falsy value I was looking for a solution where you receive some data from the database , and if it ’s empty , null , or undefined , it doesn ’t display anything . Right now , I ’m handling this by using a default value or converting to a string and checking if it ’s different from undefined . But I thought it was worth asking in case there ’s some method I don ’t know about , or maybe something smart , like when I recently discovered you can concatenate two arrays and remove duplicates . : ) ) Since null and undefined are falsy values If that value is null or undefined then it 'll be a falsy value and work to show /hide or whatever else you 'd need to do the bool check for Unlike in JavaScript , empty strings and 0 are not falsy values though so keep that in mind well "not equal " to but yeah