I had a pretty hard time with this, but I found that testing a variable for a ‘Truthy’ value works very well for me. When I say test for a ‘Truthy’ value, I mean a legit value that will return true. See below example:
var myVariable = 'Test';
The example above would return true because myVariable contains a valid value. If myVariable returned one of the following, the above example would return False:
– Empty String where length is 0.
Hope this helps 🙂