Main Navigation
Share your interview in your own words — our AI handles the rest. Hardly takes 2 minutes.
Practice mock interviews or book a 1:1 call for career guidance, resume reviews, and more.
AI interview prep powered by real interview data.
Connect with us on social media
Interview experiences & questions tagged Javascript
Given the following <ul> with multiple <li> elements, add a single event listener to the parent <ul> that logs the clicked <li> using event delegation. Explain why event delegation is preferred over attaching listeners to every <li>.
In the following object, why does this.name become undefined inside the forEach callback? Explain the value of this and fix the code without introducing any additional variables.
Implement your own version of Array.prototype.reduce() (myReduce). Explain why extending Object.prototype is not recommended, and implement it correctly by extending Array.prototype, including support for an optional initial value.
Explain how JavaScript's Array.prototype.reduce() works. What are the roles of the accumulator, current element, and initial value? Walk through the given example.
What will be the output of the following code that attaches click handlers inside a for loop using var? Why does it happen? How would you fix it so that clicking each button correctly prints 0, 1, and 2?
Coming Soon