30 JavaScript Tricky Question for interview 2026

30 JavaScript Tricky Question for interview 2026

1. var and Hoisting Question: What will be logged to the console? JavaScript Answer: Explanation: JavaScript’s hoisting mechanism moves var declarations (but not the assignments) to the top of the scope. The code is executed as if it were: JavaScript 2. let/const and the Temporal Dead Zone (TDZ) Question: What will be logged to the…