JavaScript: Predict the Output Questions vol. 2

Let’s run through some interview style questions that are a bit different from the standard blackboard interview questions you might find on LeetCode or AlgoExpert. Predict-the-output questions show your interviewer your level of understanding of the language — a skill not tested by data structure and algorithms questions.

Below are four problems, their answers, and step-by-step explanations for each. You’ll get the most out of these problems if you try to solve them yourself 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
Amy Hayes

Amy Hayes

All things software, math, and tech