JavaScript: Predict the Output Questions vol. 3

This is the third entry in my series where I try to trick you with some predict the output questions. These types of questions come up frequently in interviews and they may throw you for a loop if you’ve only been practicing algorithms questions on LeetCode. Below are questions, answers, and explanations on the quirks of the JavaScript language. These problems are meant to help you brush up on your knowledge or prep for an upcoming interview. I recommend trying the question on your own before scrolling to the answer.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store