Check if object exists

/ Published in: JavaScript
Save to your folder(s)

Copy this code and paste it in your HTML
  1. function isValidObject(objToTest) {
  2. if (null == objToTest) return false;
  3. if ("undefined" == typeof(objToTest)) return false;
  4. return true;
  5. }


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.