Exercise on Tail Call Optimization & other Function Features

In the following exercises, you will use tail call optimization, create a stack, and examine how new.target behaves in ES5.

Exercise 1:

Implement a stack in ES6. In addition to a constructor, it should have a push(), pop(), and a len() function that would return the number of elements in the stack.

Level up your interview prep. Join Educative to access 80+ hands-on prep courses.