Posted by : Jebastin Friday 25 October 2013

One option is to use typeof operator:

  1.  if (typeof val === "undefined") { // ... }
It returns a string indicating the type of the variable or other unevaluated operand. The main advantage of this method is that it will never raise an exception in case if variable val does not exist.

Leave a Reply

Subscribe to Posts | Subscribe to Comments

Link To This Post/Page

Spread The Word

Add this button to your blog:
JJ Technology Solutions

Blog Archive

Trackers

eXTReMe Tracker
facebook

- Copyright © JJ Technology Solutions - Powered by Source Code Solutions -