🔴 Get my Complete Frontend Interview Prep course - roadsidecoder.com/course-details Follow me on Twitter or you may fail in your interview 🤓 - twitter.com/piyush_eon If this video gets good response, I will make more JS interview videos, so do share it with others 🔥
Var and let can be declared without intialization Var and let can be updated but const cant be -there are 2 phases involved creation and execution . I creation window object is created then heap memory is allocated and then we initialise functions and variables with undefined (the whole function is stored inside the window object) . In execution the code is executed line by line and assigns variables . -Hoisting : during creation phase js engine moves function declarations and variable to top of the code -var variables are obv hoisted let variables are not (in normal sense they are hoisted in temporal dead zone) -temporal dead zone : a state in which let and const variables specifically are in scope but have not been declared yet .
I only studied what u said in this playlist I came here to tell u a very big Thanks ,3 months ago I got internship and I studied Java script from here Thanks a lot
You're truly the master of your craft! The content you've produced is exceptional; while many understand the theory, executing it practically is a whole different level, and you've accomplished it admirably. My sincere respect and admiration for your work, sir! Keep spreading your expertise and help around the globe 🌐
I was checking your videos from past 2 days and found your way of teaching and explanation of each and evry part in the video will clear every doubt. Excellent teaching, thanks and god bless you.
hello sir ...your way of teaching is in different level Thank you so much for that....please make some more videos on JS interviews questions. PLEASE PLEASE PLEASE.
What is the difference between lexical scope and closure give us an example side by side like which line is removed then it's a lexical scope and which line is add then it's a closure
This the first question that I get asked everytime I give an interview for React JS. The first statement the interviewer makes is "Ok let's start with some basic questions, What is hoisting in JS 💥"
Just want to point out one thing, The declaration mentioned here is not same "declaring inside of your code", Your engine processes your variables in three steps: 1. Variable declaration (not same as decalaring a variable in the code) - Meaning defining the scope. Note that it does not mean that variable's memory has been decided also. 2. Variable assignment: Here Engine decides the memory for the variable and adds a default value for it. (default value: undefined) 3. Assignment: Assigning a value to the variable. Now which of the steps falls under Creation phase and Execution phases decided nature of the hoisting. For var, 1 & 2 happens in creation phase, hence even someone accessing it before the actual "declared in the code" gives you back "undefined" . For let and const: only one happens, 2 happens only when it hits the actual code declaration (let x, const r) so basically your variable have a scope but because assignment has not been done, It is said to be in TDZ (scope defined but not memory or default value)
@@wakeengineer check any of the below : - "variable lifecycle" article by dmitripavlutin - variable lifecycle course or course notes by Bogdan Stashchuk - JavaScript Visualized - Execution Contexts by Lydia Hallie
Please make video on this challenge. I want to make a layout where there are header and main and main has multiple dynamic items of 150/150 px each. while making responsive screen, items should wraps in smaller size. header should always occupy width according to the items. for example if it has 1 item then header width should have 150px if 2 items then 300px and so on so forth.
Best on UA-cam... Better then akshay saini Previous used to watch akshsy saini for interview preparation and recalling basics of JS But your explanation is best in class
Please can you make system design for frontend developer series , By the way you taught amazingly. I watched the whole series is simply amazing 🤩. I love learn system design from you, that would be simply great
var or let may be updated, but const not var may be re-declare ,but not same with let or const var or let can be declare without initialization,but const can't
Notes: Q) What is Scope? Ans: scope refers to the accessibility or visibility of variables, functions, and objects at different parts of the code during runtime. Scope determines where variables and functions can be accessed or referenced in your code. Type of Scope: Global Scope: Accessible everywhere in the code. Function Scope: Variables are only accessible within the function they are defined in.Var has functional scope. Block Scope: Variables declared with let or const inside a block are confined to that block. Lexical Scope: Inner functions have access to variables in their outer function's scope. Q) Varible shadowing? Ans: variable shadowing occurs when a variable declared in a certain scope has the same name as a variable declared in an outer or parent scope. The inner variable "shadows" or overrides the outer variable, meaning the inner variable is given precedence within its scope, and the outer variable becomes inaccessible from that inner scope. Q) var vs let vs const? Ans: Declaration var can be redeclared and let const can not. Declareation without initialisation var and let can declare but const can not Reintialisation: var and let value can reintialise but const value can not
I'm just now going through this playlist to prep for an interview that has a javascript knowledge section. your notes are super helpful btw but how did this playlist go for you use wise and practical wise
Can you make videos related to dsa using JavaScript for the dsa round in frontend interviews - also give some idea about how to get frontend internship opportunity while in college. hoping for your reply :)
5:10 - let-let can't be shadowed it will give a error. Try it out. Please verify all the information that you show in the video as its a placement video and students will get misguided.
Good tutorial dude, what is your current package as a software developer. Just curious because I want to be as good as you and was wondering where the max package would cap haha
Can you please cover promise dependency question. "How can we call multiple promises parallelly but result should be printed sequentially. Lets say we start 3 parallel promises A,B and C. But if Promise B resolve it should check if A has been resolved or not and if it not then it should wait to print its result. Similarly C will wait for B and A. "
// Parallel execution of all promises const [resultA, resultB, resultC] = await Promise.all([promiseA, promiseB, promiseC]); // The below line will be executed only when all promises are resolved console.log(resultA, resultB, resultC);
Q1: 5( var can be initialized and declared as hoisting will bring the code to top of stack) Q2: 2,1 (var can be re-declared and re-initialized but let will print based on the block it is initialized)
I came cross one hoisting interview question. Where variable declared with var and function declaration has same name, then which one of them will be hoisted? function test(){ return abc; function abc(){} var abc = 5; } console.log(typeof test()) Ans: function
Let remains in tdz which is time period between declaration and intialization and let does not behaves as same as let because the undefined value goes in script not in window object that's y value of let can't be accessed before intialization
This is my second comment Plz make videos on react js because your explanation is amezing But your video out in 7-8 days gap plz make as soon as possible
HI, i have a table which has 3rows and 20cloumns, onclicking edit, first cell of that row should get highlighted , but last cell is getting highlighted . what can be done ..pls suggest
if I write like this then: let z = 10; function abc() { console.log(z, 'z'); } abc(); Then , here let treating as a global var and also accesible anywhere, can you explain about this one?
In JavaScript, when a function is executed, the interpreter searches for variables in the current scope. If it doesn't find the variable within the function, it moves outward (to the next scope, and so on) until it finds the variable or reaches the global scope. Since z is declared with let in the global scope, and there's no local variable z inside the function abc(), JavaScript successfully finds the global z and uses its value (10) when you invoke the function.
🔴 Get my Complete Frontend Interview Prep course - roadsidecoder.com/course-details
Follow me on Twitter or you may fail in your interview 🤓 - twitter.com/piyush_eon
If this video gets good response, I will make more JS interview videos, so do share it with others 🔥
Man Could u mak a site wih redux (Multilanguage) Please just one shoopping site
I need your help please
Var and let can be declared without intialization
Var and let can be updated but const cant be
-there are 2 phases involved creation and execution . I creation window object is created then heap memory is allocated and then we initialise functions and variables with undefined (the whole function is stored inside the window object) . In execution the code is executed line by line and assigns variables .
-Hoisting : during creation phase js engine moves function declarations and variable to top of the code
-var variables are obv hoisted let variables are not (in normal sense they are hoisted in temporal dead zone)
-temporal dead zone : a state in which let and const variables specifically are in scope but have not been declared yet .
Hy piyush,
Your java script interview series much more helpful to crack React interviews.
I got selected more than 4 companies.
Thanks.
Congratulations Paras!
will it help in nodejs interviews aswell ?
I only studied what u said in this playlist I came here to tell u a very big Thanks ,3 months ago I got internship and I studied Java script from here Thanks a lot
bhai kase milye . how you applied share some insights
You're truly the master of your craft!
The content you've produced is exceptional; while many understand the theory, executing it practically is a whole different level, and you've accomplished it admirably. My sincere respect and admiration for your work, sir!
Keep spreading your expertise and help around the globe 🌐
6:04 - You explained the concept of re-assigning new values not re-initialisation.
I was checking your videos from past 2 days and found your way of teaching and explanation of each and evry part in the video will clear every doubt.
Excellent teaching, thanks and god bless you.
This video deserves so much more engagement. Your content is really comprehensive. I signed in just to thank you lol. Keep up the good work!
Welcome aboard!
Amazing explanation of var, let and const.
Hello Piyush,
AMAZING content. Exceptional way of explaining it.
Loved it.
Please make videos on
Classes and
Design Patterns. as well.
hello sir ...your way of teaching is in different level Thank you so much for that....please make some more videos on JS interviews questions. PLEASE PLEASE PLEASE.
Thank you so much Mayank! U made my day.
Amazing explanation Piyush !! Please bring more questions on JS interview!! Keep up the good work
This is awesome 👏🙌
If you will make like this videos series then no one can stop channel growth.♥️♥️
Please make such a content 🔥
🙏❤️
Amazing, you explain the content very well! I'm preparing for an interview that will happen next week, I hope I come back with good news! :)
What is the difference between lexical scope and closure give us an example side by side like which line is removed then it's a lexical scope and which line is add then it's a closure
Very helpful thank u sir explain very good i like it and understand all method thank so much
very nicely explained thanks piyush
Thanks for making it so crystal clear thanks it helped a lot ❤
This the first question that I get asked everytime I give an interview for React JS. The first statement the interviewer makes is "Ok let's start with some basic questions, What is hoisting in JS 💥"
Yes, It helps interviewer evaluate your basics.
Enjoying all vedio i understand every topics clear more and doubts 👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌 Thank and thankyou so much explanation 🔥🔥🔥
Thank you
thanks for the video ,the video was really good to understand the concepts clearly.
Please make a series of JavaScript interview questions🙏
Yes I will!
I think there is a really good playlist. I got a 10 lpa offer from his videos. ua-cam.com/play/PLKhlp2qtUcSaCVJEt4ogEFs6I41pNnMU5.html
@@RoadsideCoderhave you did full video of javascript questions?
Just want to point out one thing, The declaration mentioned here is not same "declaring inside of your code", Your engine processes your variables in three steps:
1. Variable declaration (not same as decalaring a variable in the code) - Meaning defining the scope. Note that it does not mean that variable's memory has been decided also.
2. Variable assignment: Here Engine decides the memory for the variable and adds a default value for it. (default value: undefined)
3. Assignment: Assigning a value to the variable.
Now which of the steps falls under Creation phase and Execution phases decided nature of the hoisting.
For var, 1 & 2 happens in creation phase, hence even someone accessing it before the actual "declared in the code" gives you back "undefined" .
For let and const: only one happens, 2 happens only when it hits the actual code declaration (let x, const r) so basically your variable have a scope but because assignment has not been done, It is said to be in TDZ (scope defined but not memory or default value)
That's some deep understanding , where you get to know all these ?
@@wakeengineer check any of the below :
- "variable lifecycle" article by dmitripavlutin
- variable lifecycle course or course notes by Bogdan Stashchuk
- JavaScript Visualized - Execution Contexts by Lydia Hallie
Please make video on this challenge.
I want to make a layout where there are header and main and main has multiple dynamic items of 150/150 px each. while making responsive screen, items should wraps in smaller size. header should always occupy width according to the items. for example if it has 1 item then header width should have 150px if 2 items then 300px and so on so forth.
interesting, I thought in ES6, the 'var' had been replaced by 'let', did not know there was this global / local meaning to it as well.
Bestest Playlist❤
bro no other utuber explained shadow concept i got that topic from one of interviews thx!
Var a=0;
If(a) {
Console.log(a) ;
}
What will be the output?
nada se va a imprimir ya que el if hara una coerción de tipo sobre el cero como un falsy value y no ejecutara el codigó dentro de este condicional
Man thanks a lot, you have been so helpful ❤.
God bless you
Great course
Very perfectly explained ❤
great explaination. thanks....make videos on JS Classes
During the creation phase JavaScript engine moves your variables and functions declarations on the top of your code and this is known as hoisting.
Thanks
Thank you Piyush Sir for these amazing explanation of JS question ... please make a series of JS interview questions ..
Thanks for the appreciation 🙏 More such videos coming in this series 🔥
Best on UA-cam...
Better then akshay saini
Previous used to watch akshsy saini for interview preparation and recalling basics of JS
But your explanation is best in class
❣️
Thank you wary much for the explanation!☺️
pls, upload more and more videos. it will help me with my upcoming interviews
hi.. thank you so much for this js interview video. it helped me to pass the interview. all the best.
Congrats!
Great for interview.
please watch this video before going to interview , the psuedo kind of coding questions helps a lot in interview
Please upload videos fast of this series bhaiya...
you understand it very well, you may want to step it up.
Very nicely explained
Please can you make system design for frontend developer series ,
By the way you taught amazingly.
I watched the whole series is simply amazing 🤩.
I love learn system design from you, that would be simply great
10:47 -> ice-cream 🤣🤣
Great video btw 👍🏻
Hahah
you are an amazing tutor 😍
you and akshay saini both are awesome
excellent explanation ❤
Please make an In Depth Video on Temporal Dead Zone
var or let may be updated, but const not
var may be re-declare ,but not same with let or const
var or let can be declare without initialization,but const can't
Thank you for this 💙
really awesome video, thank you !
My pleasure!
Continue this series...
More videos incoming 😎
Thank you bro.
Notes:
Q) What is Scope?
Ans: scope refers to the accessibility or visibility of variables, functions, and objects at different parts of the code during runtime. Scope determines where variables and functions can be accessed or referenced in your code.
Type of Scope:
Global Scope: Accessible everywhere in the code.
Function Scope: Variables are only accessible within the function they are defined in.Var has functional scope.
Block Scope: Variables declared with let or const inside a block are confined to that block.
Lexical Scope: Inner functions have access to variables in their outer function's scope.
Q) Varible shadowing?
Ans: variable shadowing occurs when a variable declared in a certain scope has the same name as a variable declared in an outer or parent scope. The inner variable "shadows" or overrides the outer variable, meaning the inner variable is given precedence within its scope, and the outer variable becomes inaccessible from that inner scope.
Q) var vs let vs const?
Ans: Declaration var can be redeclared and let const can not.
Declareation without initialisation var and let can declare but const can not
Reintialisation: var and let value can reintialise but const value can not
I'm just now going through this playlist to prep for an interview that has a javascript knowledge section. your notes are super helpful btw but how did this playlist go for you use wise and practical wise
The topics covered in this playlist are very good and explanation is also very good.
Can you make videos related to dsa using JavaScript for the dsa round in frontend interviews - also give some idea about how to get frontend internship opportunity while in college. hoping for your reply :)
great your teaching is too good sir please please make a tutorial on iterator and generator
Thanks for the videos bro, very helpful for us.
Good to know 🙏
It's a lot of money for a course if it would 300 or 400 I would have enrolled in the course !!
thanks a lot
Good explanation though! Are you going to do some Interview Questions related to React? It would help a lot!
Yes that's planned too!
Well said
Keep going I learn so much from you
🙏
Thank you
Well looking forward for more
On the way!
👍👍
Helpful ❤
Completed ✅
your content is awesome
🙏
awesome bro
thanks bro after that follow msg at 6:00 I spended 30 min on twitter 😶
😂
5:10 - let-let can't be shadowed it will give a error. Try it out. Please verify all the information that you show in the video as its a placement video and students will get misguided.
Good tutorial dude, what is your current package as a software developer. Just curious because I want to be as good as you and was wondering where the max package would cap haha
Can you please cover promise dependency question. "How can we call multiple promises parallelly but result should be printed sequentially. Lets say we start 3 parallel promises A,B and C. But if Promise B resolve it should check if A has been resolved or not and if it not then it should wait to print its result. Similarly C will wait for B and A. "
I don't know why this comment has no reply from @RoadsideCoder
Hey, Yeah sure I'll cover it in my promises video!
// Parallel execution of all promises
const [resultA, resultB, resultC] = await Promise.all([promiseA, promiseB, promiseC]);
// The below line will be executed only when all promises are resolved
console.log(resultA, resultB, resultC);
It would be very helpful if you can create interview coding ques series on Js
Q1. a=5;
console.log(a);
var a;
Q2: function abc() {
var a = 1;
let b = 1;
{
var a = 2;
let b = 2;
}
console.log(a, b);
}
abc();
Q1: 5( var can be initialized and declared as hoisting will bring the code to top of stack)
Q2: 2,1 (var can be re-declared and re-initialized but let will print based on the block it is initialized)
where do you work bro?
Best videos
Awesome really helpful! Please make videos on react interview preparation also.
Yes, soon!
Thanks bhai
I came cross one hoisting interview question.
Where variable declared with var and function declaration has same name, then which one of them will be hoisted?
function test(){
return abc;
function abc(){}
var abc = 5;
}
console.log(typeof test())
Ans: function
Thanks for sharing
Can u please explain it why
you opened my third eye after this.
Haha
great video man!😊
Thanks 🙏
x=9
console.log(x)
let x
//since let is hoisted it will move to the top,gets declared and in next step gets a value assigned. then why there is error
Let remains in tdz which is time period between declaration and intialization and let does not behaves as same as let because the undefined value goes in script not in window object that's y value of let can't be accessed before intialization
@@Aptilover okk thanks.... U r doing MERN Stack?
@@lakshaychauhan380 no focusing on frontend
@@Aptilover but there are less opportunities in front end
great series 🙂
Thanks
the voice at 10:50 🤣🤣🤣
This is my second comment
Plz make videos on react js because your explanation is amezing
But your video out in 7-8 days gap plz make as soon as possible
Bro I've made a lot of videos on react js on my channel. You can check them out.
HI, i have a table which has 3rows and 20cloumns, onclicking edit, first cell of that row should get highlighted , but last cell is getting highlighted . what can be done ..pls suggest
Continue this series bro
For sure
nice video. create more videos like this
Definitely
Cover javascript decorator function for debouncing.
Wow🤪😍😍
Your voice is great
Thank you 🙏 Can I make a career as a voice artist? 👀
@@RoadsideCoder hope so
@@RoadsideCoder how can i start contributing in open for getting a remote job
@@danish7335 U don't need open source to get a remote job. Work on your skills and building a personal brand on social media
@@RoadsideCoder thnx for your valuable reply
Thanks for the great content, could I ask if these questions are asked on junior roles?
Yes!
@@RoadsideCoder thanks for your reply 🙏 I had my first interview today and your videos helped
@@meri8375 wow that's amazing dude!
Can you please make videos on Redux, reducers, and middleware for beginners?
I have made, you can check in my channel!
Please make series of important dsa questions too and design questions asked in interview
Ok brother
if I write like this then:
let z = 10;
function abc() {
console.log(z, 'z');
}
abc();
Then , here let treating as a global var and also accesible anywhere, can you explain about this one?
In JavaScript, when a function is executed, the interpreter searches for variables in the current scope. If it doesn't find the variable within the function, it moves outward (to the next scope, and so on) until it finds the variable or reaches the global scope.
Since z is declared with let in the global scope, and there's no local variable z inside the function abc(), JavaScript successfully finds the global z and uses its value (10) when you invoke the function.
Bro i want to tecah my nephew software dev what shud he begins with first kindly guide?
Will you provide pdf for interview questions
Make a video on execution context and call back
Sure!
Will it support all browsers. Ie11 especially
Yep