First: Chapter 4 is a duplicate of another chapter and does not contain the Stack examples, it also contains a duplicate directory of Chapter-1.
Second: The book uses some old coding practices that might not be noticed by beginners. For example we can now confidently use native functions for things like the Stack. Here is a performance analysis over different Array.push() functions, and take notice that Node.js uses the same V8 engine as Chrome.