What is the difference between undefined and null in JavaScript?

Asked by Last Modified  

Follow 2
Answer

Please enter your answer

I am online Quran teacher 7 years

undefined means a variable has been declared but has not yet been assigned a value, whereas null is an assignment value, meaning that a variable has been declared and given the value of null .
Comments

Experienced Full Stack Developer and Instructor.

undefined: It is a type in JavaScript.Indicates the absence of a value or that a variable has been declared but not assigned a value. null: It is an object (due to a historical bug in JavaScript).Represents the intentional absence of any object value, used explicitly to denote "nothing" or "empty." ...
read more
undefined: It is a type in JavaScript.Indicates the absence of a value or that a variable has been declared but not assigned a value. null: It is an object (due to a historical bug in JavaScript).Represents the intentional absence of any object value, used explicitly to denote "nothing" or "empty." read less
Comments

Related Questions

How to learn Javascript?
I would say, https://developer.mozilla.org/en-US/docs/Learn/JavaScript is the best place to learn if you want real good knowledge in Javascript. Have a little bit patience and put some effort in learning...
Profile Photo
Ramya
What types of jobs are available for those that know just HTML/CSS and JavaScript?
By being hired by companies that require front-end development. I don't only know JavaScript, CSS and HTML, but they're pretty much the only technologies I ever use at work, because there's so much front-end...
Profile Photo
Pritty
0 0
View Comments5
x eskor plus two x plus one
what is the question? can't understand the meaning.
Profile Photo
Ankur
0 0
View Comments8
How do I become better at JavaScript?
Go through JavaScript tutorials from w3schools.com site. They have good examples with description. Then learn some es6 and es7 syntax. You will be pro in JavaScript.
Profile Photo
Pooja
0 0
View Comments5

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

What Should I Learn in 2025 for Frontend or Web Technology?
If you're wondering what to focus on in 2025 to excel in frontend development, here's a concise guide: 1. React.js React remains one of the most in-demand technologies for building modern web applications....
Profile Photo

Some good resources
Clean Code by Robert C Martin, is available in my profile please download and read it, irrespective of what language you code in, it will change the way you code. Also if you code in Javascript read https://12factor.net/ https://blog.risingstack.com/javascript-clean-coding-best-practices-node-js-at-scale/ For...
Profile Photo


Angular 1 vs Angular 2
Angular team has released the angular 2, which has drastically change the way programmers interact and work with Angular framework in the past. In this post I will tell you the common changes made by...
Profile Photo

Inversion of Control
Problem You have classes that have dependencies on services or components whose concrete type is specified at design time. In this example, ClassA has dependencies on ServiceA and ServiceB. Figure 1 illustrates...
Profile Photo

Recommended Articles

Here are the top 6 must have skills for every Web Designer : Technical Skills Web designers undoubtedly require very strong technical skills. They must have hands on using Web designing software and tools, such as Adobe Dreamweaver, Fireworks, Photoshop, Flash etc. In addition to the knowledge of design...

Read full article >

Software Development has been one of the most popular career trends since years. The reason behind this is the fact that software are being used almost everywhere today.  In all of our lives, from the morning’s alarm clock to the coffee maker, car, mobile phone, computer, ATM and in almost everything we use in our daily...

Read full article >

Hadoop is a framework which has been developed for organizing and analysing big chunks of data for a business. Suppose you have a file larger than your system’s storage capacity and you can’t store it. Hadoop helps in storing bigger files than what could be stored on one particular server. You can therefore store very,...

Read full article >

Business Process outsourcing (BPO) services can be considered as a kind of outsourcing which involves subletting of specific functions associated with any business to a third party service provider. BPO is usually administered as a cost-saving procedure for functions which an organization needs but does not rely upon to...

Read full article >

Looking for Java Script Training classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you