JavaScript's Most NOTORIOUS Interview Question

preview_player
Показать описание
Can you solve this notorious JavaScript coding interview "trick" question?

Prepping for your frontend interviews? Use code "conner" for a discount on my course FrontendExpert:

Socials:
Рекомендации по теме
Комментарии
Автор

Thanks for watching! The full explanation of how to get to this solution will come out tomorrow. I try to avoid doing the cheesy multiple part thing, but this one just couldn’t all fit in 60 seconds 🙃

ConnerArdman
Автор

Var assigns i in the global scope, so by the time it prints i is at the end of the loop.

Don't use var.

Wezla
Автор

In the first example, i definitely got a syntax error in the console. I tried with and without use strict and both errored out. Maybe they fixed it? 🤷‍♂️

bktp