Predict the output - episode 3 - Javascript

Veröffentlicht am: 31 Dezember 2022
auf dem Kanal: Code on Mars
40
1

Output
5
5
5
5
5

Due to the use of "var" in for loop, it creates a global variable "i" and stores it in heap memory. And once the callback of setTimeout is called, it then uses the global "i" whose value is now 5.

📖 Suggested books
Introduction to Algorithms - https://amzn.to/3IdqpHu
Data Structures And Algorithms Made Easy: Data Structures - https://amzn.to/3vuqVJE
SPEAKING JAVASCRIPT AN IN-DEPTH GUIDE FOR PROGRAMMERS - https://amzn.to/3i149FU
Cracking the Coding Interview - https://amzn.to/3jJnzjm
DESIGNING DATA-INTENSIVE APPLICATIONS - https://amzn.to/3GqD4Wa
Atomic Habits: The life-changing million-copy bestseller - https://amzn.to/3IcETHm
System Design Interview - An insider's guide - https://amzn.to/3jDZtqa
DEEP WORK: RULES FOR FOCUSED SUCCESS IN A DISTRACTED WORLD - https://amzn.to/3GrumHg

Better way to prepare for Frontend interviews - https://preparefrontend.com


Auf dieser Seite können Sie das Online-Video Predict the output - episode 3 - Javascript mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Code on Mars 31 Dezember 2022 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 40 Mal angesehen und es wurde von 1 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!