JavaScript for Developers 14 - Difference between undefined and null

preview_player
Показать описание

A commonly asked question is how to differentiate between undefined and null. When to use what? We'll cover this difference in this tutorial.
Рекомендации по теме
Комментарии
Автор

NULL is Explicitly Defined, Undefined is Implicitly Defined

danialmalik
Автор

Sir, the segment where you talk about the difference between undefined and null, you just taught not just us Javascript but common sense itself. Thank you.

viplovedev
Автор

I got into coding not long ago and found your channel just recently. Had to stop the video to express my sincerest gratitude! Wow, just WOW! THANK YOU!

aldin
Автор

The explanation you are giving abt the topics are just mind blowing. kindly please give more to us like this. respect for this videos hats off to u.

shashikumar-qwez
Автор

What a terrific analogy for the difference between undefined and null - Thanks so much

markcaruso
Автор

Kaushik, I am sure you must have brainstormed this for a while, to make us understand in a go! Superb analogy. Keep it up!

lpjznsm
Автор

Best analogy I've seen, hats off to you

dreamscapeai
Автор

Putting things so simple, and knitted so well. Thanks for such great learning session. Salute.

saptaswasarkar
Автор

I like the metaphor with form example that's exactly what I needed. Thanks

MrTORISSIMO
Автор

Hello Sir, do you have videos on Java tutorials also.(J2SE, J2EE)? I mainly came here for Java tutorials getting refered from someone on Quora. But, I found JavaScript Series videos which are absolutely great till now. Please, let me know if you have tutorials on Core Java and Jdbc etc

prabhupadswain
Автор

is it like this ???

you declare a variable in javascript like this-
var a;

now, since javascript is a type-less language. We don't declare a type while declaring a variable. And the type of a variable depends on the type of value assigned to it. At runtime this can change.

So when we declare a variable saying var a; but we don't initialize it, since there is no type assigned to the variable javaScript initializes it with undefined. (instead of initializing it with say - 0.0, "", or false)

Further Any value in JavaScript that is not a string, a number, true, false, null, or undefined is an object.

if a variable is null it means absence of Object in javaScript.

you can declare a variable say
var obj = null;
and

var num;

here obj is going to be null & num is going to be undefined.
if we check the type of these 2


console.log(typeof num); // this will print undefined

console.log(typeof obj); // this will print Object - it means null is absence of object....

nitintakale
Автор

That's a good one...I have a middle name .. ;)

dhananjaypatankar
Автор

I agree your video give a great explanation but some points you mix java and javascript so who know java prog. then them for it to difficult to understand.
So I suggest dont use simply java u used with full name as javascript.... I hope u got it...

muhammedismail
Автор

no sense from dev prospective - null and undefined = no value;

javasoldier
Автор

im not racist but im sorry if this comes off a bit racist but, why tf is every coding video explained by an indian makes it so much harder to understand let alone understanding the concepts of coding pisses me off

onxx-