Null and Undefined In Javascript | Complete Javascript Tutorials | #13

Published: 05 July 2023
on channel: Utkarsh Gupta
23
2

In this video we have introduced the concept of null and undefined which is used in the Javascript.

The null keyword in JavaScript is a falsy data type that denotes that the data type is null. Falsy type refers to the coercion of null to false during conditional statement executions.Null is an object in JavaScript and represents primitive data types. A null value in JavaScript is used for referring absence of any object value and if any function or variable returns null, then we can infer that the object could not be created. If we pass null as the default parameter to any function type it would take the ‘null’ as a value passed to it.

The value null is written with a literal: null. null is not an identifier for a property of the global object, like undefined can be. Instead, null expresses a lack of identification, indicating that a variable points to no object. In APIs, null is often retrieved in a place where an object can be expected but no object is relevant.

Undefined is a type of Data type in JavaScript. When a variable is declared and not initialized or not assigned with any value. By default, the variable was stored with an Undefined value. Undefined is a global read-only variable that represents the value Undefined. Undefined is a type of primitive typeSyntax:var variable = undefined;

var no; Both no and variable contain an undefined value.1. Undefined Value in variables: When a variable is declared or not initialized but not assigned with any value then JavaScript.

undefined is a property of the global object. That is, it is a variable in global scope.

In all non-legacy browsers, undefined is a non-configurable, non-writable property. Even when this is not the case, avoid overriding it.

A variable that has not been assigned a value is of type undefined. A method or statement also returns undefined if the variable that is being evaluated does not have an assigned value. A function returns undefined if a value was not returned.
We hope that you all like our videos and do share and subscribe the channel.
#javascript
#code
#coding
#codelife
#codeschool
#webdeveloper
#webdevelopment
#webdevelopmenttutorial
#javascriptforbeginners
#javascriptfullcourse


On this page of the site you can watch the video online Null and Undefined In Javascript | Complete Javascript Tutorials | #13 with a duration of hours minute second in good quality, which was uploaded by the user Utkarsh Gupta 05 July 2023, share the link with friends and acquaintances, this video has already been watched 23 times on youtube and it was liked by 2 viewers. Enjoy your viewing!