Guruji Point - Code You Want To Write

  • Home
  • Asp.Net
  • WCF
  • SQL
  • Type Script
  • AngularJS
  • Tech News
  • Blog
  • Earn Online

Tuesday, 1 August 2017

JavaScript checking for null vs. undefined

 check null and undefined, guruji point, Gurujipoint, javascript, remove undefined error in javascript, use of null     No comments   


Introduction
In this article we will learn how to check the value is undefined or null in javascript. Maintain your code in a good manner to avoid undefined issue. We already talked about the difference between null and undefined. 

Previous Updates

In previous articles we have learnt  Transaction Commit and Rollback in sql server with example.What is Lock and how to achieve lock on sql table. Authorization in Asp.Net. How high quality content affects your Website. What is Blocking and Deadlock In SQL. Top 30 Asp.net interview question. What is the difference between null and undefined.

How do i check for null and undefined
There is no big code and complexity to check null and undefined in javascript.

Check for null
if (a == null) 
Or
if (a === null) 

Check for undefined
if (typeof a === "undefined")
Or
if (a === "undefined")
Or
if (a == "undefined")

Check for null and undefined using same code
if (!a) {
    // a will be false for null , undefined as wll as for empty string "".
}

Difference Between null and undefined in Javascript. Read more




  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Email ThisBlogThis!Share to TwitterShare to Facebook
Newer Post Older Post Home

0 comments:

Post a Comment

Facebook Updates

Guruji Point

Categories

comma seperated string in sql Comman table Expression in SQL Dynamic Grid Row IQueryable in c# Learn AngularJS row_number() and dense_rank() salary table structure. Scope_Identity() Use of indexes while loop in sql why do we need cursor why tuple used

About Us

This blog is about the Programming ,Tech News and some intresting facts related Contents. Here you can find fundamental and expert level topic of programming languages very practically related to C# , Asp.Net ,Sql-Server, JavaScript, Jquery, WebServices And also Web-Api, WCF ,WPF, Angular Js.

Contact Us

Email Us - gurujipoints@gmail.com
Contact- 8077657477

Reach Us

Copyright © Guruji Point - Code You Want To Write