Jump to content

  • Free consultations and support
  • Live chatClick Here for Live Chat
  • Call ico 1888-906-1888
    Phone support: Open

    Ready for your call :)

    Our business hours:

    Mon — Fri, 2am — 8pm (EST)

    US & EU support teams

    Phone support: Closed

    We are back in: 1h 20m

    Our business hours:

    Mon — Fri, 2am — 8pm (EST)

    US & EU support teams


Checking Null value in JavaScript

null value javascript

  • Please log in to reply
 

#1 Salwa

Salwa

    Senior Member

  • Designer
  • 181 posts

Posted 21 July 2013 - 12:56 PM

1. First declare your variable like this
var myV = null;
2.Evaluate if your variable is null. Wrap the executable code with the following statement :
if (myVal== null) {
}
This statement lets you execute the code only if myV is null.

3.Evaluate if your variable is not null. The "!" operator makes the compiler run the statements if your result is false.
if (!yourname) {
}




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users