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 Values in JavaScript

checking null values javascript

  • Please log in to reply

#1 SmartWeb


    Senior Member

  • Designer
  • 271 posts

Posted 06 December 2012 - 09:36 PM

Checking for the null values before executing the code limits a number of errors.
To check the Null values in JavaScript, do the following:
1.First declare the variable. Type the below lines into your JavaScript code:
var myVa = null;
This will allocate memory and will define the variable
2. Evaluate if the variable is null.
if (myVa== null) {
This will give a way to execute the code if myVa is null.
3. Evaluate if the value is not null. You may want to run a specific code when the value is not null. The "!" makes the compiler to run the statements only if you get a false result.

if (! MyVa) {

Also tagged with one or more of these keywords: checking null values, javascript

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users