13 JS Variable is null – JavaScript for Beginners.

Last updated on July 13th, 2020 at 02:34 pm.

13 JS Variable is null - JavaScript Tutorial 2018

This video is taken from the full course that will teach you HTML, CSS, Programming concepts and Javascript .

Video Transcript:

Hey, and welcome back.

What does it mean if a variable has a value of NULL.

Well in JavaScript, NULL is treated just like zero.

So if I was doing some kind of, or some kind of arithmetic, and I was using NULL, it would behave just as zero.

So let’s see this and we leave it here in Scratchpad.

So if I come here, let me delete all of this.

So let’s say ‘var’, ‘var’ let’s call variable var tax=null; and then ‘alert’, let’s do some kind of arithmetic.

So let’s say null times, times 10,000 and then we run this, you see it’s equal to zero, because it’s treated as zero.

So we can also say ‘null+10,000’, if we run this, it’s 10,000.

So null is treated as zero.

Let’s continue in the next video.

And in the next video, we’ll start looking at variable hoisting.

See you then.

This section is from Learn Javascript from Scratch.

Learn Javascript from Scratch

Comment Here

Need WordPress help? Linux Server help? Talk to us.

  • We are your own WordPress customer service.
  • We set up Linux servers and install or migrate WordPress. Learn more here.
  • We support WooCommerce too.
  • Check out our WordPress customer support plans here or contact us below .

If you have any questions regarding WordPress support, Linux server support or any of our services, feel free to reach out or read more on our services page.

Join this free course:

How to host multiple WordPress
websites on a VPS

Close me!