JavaScript Hoisting refers to the process whereby the interpreter appears to move the declaration of functions, variables or classes to the top of their scope, prior to execution of the code. Hoisting allows functions to be safely used in code before they are declared.
Initialization is the assignment of initial value to a variable. Initialization must be done before the variable is used. Otherwise, the variable will hold a value of "undefined" or "null", which is not desired.
Declaration of a variable in a computer programming language is a statement used to specify the variable name and its data type. Declaration tells the compiler about the existence of an entity in the program and its location. When you declare a variable, you should also initialize it.
Initialization is the process of assigning a value to the Variable. Every programming language has its own method of initializing the variable. If the value is not assigned to the Variable, then the process is only called a Declaration.
#javascript #tutorialhindi #hoisting
In this tutorial, you are going to know about:
JavaScript Declarations are Hoisted
The let and const Keywords with hoisting
JavaScript Initializations are Not Hoisted
what is hoisting: Declare Your Variables At the Top!
In JavaScript whenever you declare available it follows a principle to get to the top of the scope and that is what we call hoisting in JavaScript.
I understand just by reading this you are not able to understand what I am talking about.
That's why I created this tutorial where you will look at what it really means and what benefits you will get when you know the concept of hoisting.
Whenever in JavaScript you declare a variable it follows Hoisting.
No matter which variable you are using either it could be var or it could be let or const.
You must understand here that hoisting only works when you declare a variable and when you initialize the variable hoisting doesn't work so that is why you will see a very different behavior with all these three different methods to define available.
And this is because when we declare a var variable it doesn't follow the rule of blocks and scopes.
So when I declare a var variable in our program it just simply reached the top level of the program as a declaration.
But when we are using let or const this behavior is totally different you will see it in the video with a nice explanation.
I hope this video had help you to understand one of the most complicated topics in JavaScript.
And I am really very happy that I get this chance to share it with you.
At last, I just want to request you to please like my video shares my channel, and please subscribe.
Your support is what I am looking for and I told you you don't have to spend anything on that.
#javascripthindi #javascripttutorials #javascript
About Revive Coding:
====================
Revive Coding, is a place to learn web development with a practical approach. Breaking complex concepts into simple ones is my motive while creating videos, so that, you learn fast and get your dream job.
About me:
=========
I am vikash singh, Working as a MERN stack and Ruby on Rails Developer. Learning new concepts every day is my motivation and teaching is my hobby.
my youtube handle is @revivecoding
==========
My Guru Manta: THE FASTER YOU FAIL, THE FASTER YOU SUCCEED.
==========
Thanks for SUBSCRIBING "Revive Coding".
Wish You a Happy and Prosperous Life.
Channel Milestone:
100 Subscriber - 20 Oct 2022
110 Subscriber - in progress
En esta página del sitio puede ver el video en línea Hoisting, Initialization and Declaration | JavaScript Tutorial de Duración hora minuto segunda en buena calidad , que subió el usuario Revive Coding 26 octubre 2022, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 183 veces y le gustó 9 a los espectadores. Disfruta viendo!