10 Best Picks

Top 10 Most Useful Programming Tips, Tools, and References

Member-only story

10 Mind-Bending JavaScript Interview Questions Explained

--

Created by Canva

JavaScript interviews can be tricky. Sometimes, you get questions that seem simple but have surprising answers. These questions test how well you really know the language.

In this article, I’ll break down 10 mind-bending JavaScript interview questions in the simplest way possible. No confusing terms — just clear explanations.

Let’s get started!

1. What Does 1 + "1" - 1 Equal?

Question:

console.log(1 + "1" - 1);  

What You Might Think:

  • 1 + 1 = 2, then 2 - 1 = 1. So, the answer should be 1.

What Actually Happens:

JavaScript sees 1 + "1" and thinks: "One of them is a string, so I’ll convert both to strings and combine them."

  • 1 + "1" becomes "11" (string).

Now, "11" - 1 forces JavaScript to treat "11" as a number.

  • 11 - 1 = 10.

Final Answer: 10

Why This Matters:

  • JavaScript changes types automatically (called type coercion).

2. Why Does "hi".__proto__.__proto__ === Object.prototype Return true?

--

--

10 Best Picks
10 Best Picks

Published in 10 Best Picks

Top 10 Most Useful Programming Tips, Tools, and References

Shantun Parmar
Shantun Parmar

Written by Shantun Parmar

Software Engineer and Full Stack Developer specializing in Python & JavaScript | Link : https://www.linkedin.com/in/shantun-parmar/

Responses (4)