How to Check for undefined or null in JavaScript | CodeTrail