Today's video is for beginners. We'll talk about null and undefined and tackle a simple question. It's really simple, but it turns out that even seasoned developers forget about this language feature and make mistakes. The worst thing is when this happens during interviews.
What is Null? According to the ECMAScript specification, Null is a primitive data type. This type has only one value—null. It's used when you need to explicitly indicate the absence of a value.
Null is often used to indicate the absence of an object value. However, this rule isn't strictly defined anywhere. Developers use this approach similarly to other programming languages.
So, today we'll discuss null and undefined in JavaScript.
Useful links:
Why is typeof null === 'object'? (https://habr.com/ru/articles/200664/)
Contents:
00:00 Intro
01:05 What is Null?
01:49 Null in Code
02:34 When is Null Used?
03:17 Null and Undefined
05:01 How to Check for Null
07:01 Bug in JavaScript
08:48 Several Ways to Check for Null
11:27 Does the isNull Function Exist?
12:24 Writing the isNull Function
14:07 Summary. Brief Summary