JavaScript code execution | Hoisting |Execution Context| JavaScript Interview series in Hindi

  Рет қаралды 17,453

Pepcoding

Pepcoding

Күн бұрын

Please consume this content on nados.pepcoding.com for a richer experience. It is necessary to solve the questions while watching videos, nados.pepcoding.com enables that.
NADOS also enables doubt support, career opportunities and contests besides free of charge content for learning. Time Stamps
0:00 Introduction
1:12 execution context
5:44 global context
11:00 answers of the questions
For a better experience and more exercises, VISIT: www.pepcoding.com/resources
Hello Everyone,
I will be talking about how code runs inside a JavaScript Engine,
I will majorly covering three important concepts that are frequently asked in interviews.
* What is execution context in JS
* What is Hoisting
I will also be covering two interview question around hoisting that in generally asked in interview
Playlist Link: • Complete Web Developme...
Have a look at our result: www.pepcoding.com/placements
Follow us on our FB page: / pepcoding
Follow us on Instagram: / pepcoding
Follow us on LinkedIn: / pepcoding-education
Join our telegram group : t.me/pepcoding

Пікірлер: 55
@Pepcoding
@Pepcoding 3 жыл бұрын
Playlist Link: kzbin.info/aero/PL-Jc9J83PIiEeD3I4VXETPDmzJ3Z1rWb4
@klmehtaclass8th236
@klmehtaclass8th236 2 жыл бұрын
error because The code execution will break because with function initialization, the variable will be hoisted as a variable, not as function. So with variable hoisting, memory allocation will happen with the initialization with undefined. That's the reason we will get the error:
@prateekbansal2014
@prateekbansal2014 2 жыл бұрын
last vale question me mja agya .... proper concept clear hogya osko solve krne se
@harshitsharma5647
@harshitsharma5647 Жыл бұрын
From Today I started watching this series it is very useful Sir. Thankyou for making this series. Answer: varName undefined varName undefined varName Captain America Hello from fn Hello from fn error I am an expression
@ashutoshranjan4644
@ashutoshranjan4644 Жыл бұрын
Answer to question given at the end: It will result in error. Since function is declare as variable which is initialised to undefined before it's code execution.
@shivanshgupta1509
@shivanshgupta1509 10 ай бұрын
Thankyou Pep!!
@thelootmachine9257
@thelootmachine9257 2 жыл бұрын
Understood the entire execution flow and finished the assignment
@Pepcoding
@Pepcoding 2 жыл бұрын
Keep going. And for better experience, visit nados.io, where you will get well curated content and career opportunities.
@rajaryan5884
@rajaryan5884 3 жыл бұрын
THANK YOU SIR MAZA AA RAHA HAI ROZ AAYE BAS VIDEOS AISEN HI
@Pepcoding
@Pepcoding 2 жыл бұрын
web dev course has been resumed....latest video is coming at 8:00 PM Today Video Link: kzbin.info/www/bejne/Y2rPaXZ4gLmrbNE
@vanshika8073
@vanshika8073 3 жыл бұрын
Thankyou sir 🙏 Answer:- varName undefined varName undefined varName Captain America Hello from fn Hello from fn error (if we remove error) I am an expression is printed at last.
@sahiljain2524
@sahiljain2524 2 жыл бұрын
Yeah same 👍
@shubamgoswami
@shubamgoswami 2 жыл бұрын
Last m error kyu tha plzz explain
@omyerawar7976
@omyerawar7976 2 жыл бұрын
@@shubamgoswami because that second function is a function expression and not a function declaration. In hoisting only variable declarations and function declarations are moved at the top of our code and since the second function is not a function declaration it is not moved to top, so now its like you are trying to call a function which does not exist. This is the reason it will give error. Hope you got the point :)
@klmehtaclass8th236
@klmehtaclass8th236 2 жыл бұрын
error because The code execution will break because with function initialization, the variable will be hoisted as a variable, not as function. So with variable hoisting, memory allocation will happen with the initialization with undefined. That's the reason we will get the error: please like so that many people can see why it cause error
@ritikkaushik3493
@ritikkaushik3493 2 жыл бұрын
expression se pehle wale mein call mein error aayegi ki yeh function nhi hai. but agar console.log(fncontainer); yeh karta hoon toh undefined aata hai.
@pranavp9123
@pranavp9123 3 жыл бұрын
Real game changer is back 💯😅 Badiya video
@Pepcoding
@Pepcoding 3 жыл бұрын
Keep learning, Keep growing and keep loving Pepcoding!😊
@shubhampokhriyal8491
@shubhampokhriyal8491 3 жыл бұрын
Great
@rohansharma4844
@rohansharma4844 3 жыл бұрын
Thanku very much for clear and concise explanation of the topic.
@Pepcoding
@Pepcoding 3 жыл бұрын
I am glad you liked it. I also hope that you are watching till end and trying to understand the what, how and especially why of the problem. If you like our efforts, we request a review g.page/Pepcoding/review?rc You can subscribe to our channel here kzbin.infoabout?view_as=subscriber
@rohansharma4844
@rohansharma4844 3 жыл бұрын
@@Pepcoding already subscribed. And please keep making these videos and include interview based examples.
@nishantbharwani852
@nishantbharwani852 3 жыл бұрын
Amazing Video!!
@Pepcoding
@Pepcoding 2 жыл бұрын
web dev course has been resumed....latest video is coming at 8:00 PM Today Video Link: kzbin.info/www/bejne/Y2rPaXZ4gLmrbNE
@kmane8593
@kmane8593 Жыл бұрын
y r the great
@harshsingh5834
@harshsingh5834 Жыл бұрын
thank u bhaiya ❤
@himanshugupta8937
@himanshugupta8937 3 жыл бұрын
Is month k end tak js kra dijiye project k saath❤️
@Pepcoding
@Pepcoding 3 жыл бұрын
Pakka done bro
@girishpandey2936
@girishpandey2936 2 жыл бұрын
Nice Tutorials
@Pepcoding
@Pepcoding 2 жыл бұрын
Glad you like them! For better experience and precisely arranged content you can visit on nados.io
@aadya1944
@aadya1944 2 жыл бұрын
sir it helps lot
@Pepcoding
@Pepcoding 2 жыл бұрын
Glad you liked it! Keep learning. And for better experience, visit nados.io, where you will get well curated content and career opportunities.
@somith16
@somith16 3 жыл бұрын
Awsome
@Pepcoding
@Pepcoding 3 жыл бұрын
Thankyou I am glad you liked it. I hope that you are watching till the end and trying to understand what, how, and especially why of the problem. If you like our efforts, will you like to write a few words about us here (www.quora.com/What-are-the-good-websites-to-learn-data-structures-and-algorithms )
@shivamkumarpathak3640
@shivamkumarpathak3640 3 жыл бұрын
Thanku bhaiya🙏
@Pepcoding
@Pepcoding 3 жыл бұрын
Beta flow me aa chuke hai roz aayengi videos
@shivamkumarpathak3640
@shivamkumarpathak3640 3 жыл бұрын
@@Pepcoding thanku bhaiya thanku very much
@rajmaurya1605
@rajmaurya1605 3 жыл бұрын
@@Pepcoding thanks 🙏
@abhinavverma1603
@abhinavverma1603 3 жыл бұрын
Thanks
@Pepcoding
@Pepcoding 3 жыл бұрын
Welcome
@vikaschaudhary6641
@vikaschaudhary6641 3 жыл бұрын
Web development ka jo paid content h and jo ye KZbin p web dev ki series aa rhi h ,kya ye dono same h content wise?
@Pepcoding
@Pepcoding 3 жыл бұрын
Yes
@imperativeinversion7534
@imperativeinversion7534 3 жыл бұрын
Sir next project konsa aayega agr aap thoda spoiler dena chaho toh 👉👈🙂
@Pepcoding
@Pepcoding 3 жыл бұрын
Aise kaise. Trailer hi bna ke denge iska
@imperativeinversion7534
@imperativeinversion7534 3 жыл бұрын
@@Pepcoding Ohk Sir eagerly waiting 😅
@Pepcoding
@Pepcoding 2 жыл бұрын
web dev course has been resumed....latest video is coming at 8:00 PM Today Video Link: kzbin.info/www/bejne/Y2rPaXZ4gLmrbNE
@imperativeinversion7534
@imperativeinversion7534 2 жыл бұрын
@@Pepcoding 🙌🙌🔥
@baniyaindia
@baniyaindia 2 жыл бұрын
var fncontainer not clear pls help
@Pepcoding
@Pepcoding 2 жыл бұрын
we are going to upload 3 lakh+ videos on our platform nados.pepcoding.com You will find better experience and precisely arranged content. You can also share your feedbacks and ask your query on NADOS's community tab. And for more updates keep following us on Instagram instagram.com/pepcoding/
@purnachandramansingh3604
@purnachandramansingh3604 3 жыл бұрын
Before Lecture: 1. You both are wasted 😂😂 2. 😳 No I am the real one After Lecture: 1. You both are wasted 😂😂 2. You both are wasted 😂😂 Last Question --------------------- varName undefined varName undefined varName Captain America Hello from fn Hello from fn //Maybe error I am an Expression
@Pepcoding
@Pepcoding 3 жыл бұрын
There will be error not may be 😅😅
@748saurabhkumar4
@748saurabhkumar4 3 жыл бұрын
undefined undefined Captain America Hello from fn Hello from fn undefined I am an Expression
@748saurabhkumar4
@748saurabhkumar4 3 жыл бұрын
@@nm_nishant ok bhai, thanks😊
@ParthPatel-vj2zv
@ParthPatel-vj2zv 3 жыл бұрын
Yes. At line 11, code execution will halt with error since fnContainer variable has memory allocated but value(function expression) is not assigned yet. So line 15 will not even get chance for execution unless error is corrected Once error is corrected line 15 will give output of ' I am expression'
MOM TURNED THE NOODLES PINK😱
00:31
JULI_PROETO
Рет қаралды 10 МЛН
Sigma Girl Education #sigma #viral #comedy
00:16
CRAZY GREAPA
Рет қаралды 77 МЛН
CAN YOU HELP ME? (ROAD TO 100 MLN!) #shorts
00:26
PANDA BOI
Рет қаралды 36 МЛН
ELE QUEBROU A TAÇA DE FUTEBOL
00:45
Matheus Kriwat
Рет қаралды 22 МЛН
React 19 New Features - Hindi 🚀
13:11
Studytonight with Abhishek
Рет қаралды 1,5 М.
Counting Bits - Dynamic Programming - Leetcode 338 - Python
13:24
How JavaScript Works 🔥& Execution Context | Namaste JavaScript Ep.1
4:58
Pacific Atlantic Water Flow - Leetcode 417 - Python
16:28
NeetCode
Рет қаралды 152 М.
3.2 Transport layer multiplexing and demultiplexing
14:20
JimKurose
Рет қаралды 80 М.
Less code: Composable functions - MAD Skills
9:44
Android Developers
Рет қаралды 73 М.
MOM TURNED THE NOODLES PINK😱
00:31
JULI_PROETO
Рет қаралды 10 МЛН