Summary
In this chapter, we have seen how the blocks of code many people think of as just 'JavaScript" can actually be broken down into separate components: the JavaScript engine, consisting of the call stack, memory heap, and the garbage collector (as well as other important components not covered by this chapter); and the JavaScript runtime environment, such as a browser, or Node.js, which contains the JavaScript engine, and gives the engine access to additional functions and interfaces, such as setTimeout()
or a filesystem interface.
We also looked at how JavaScript manages memory allocation and deallocation, and how even though it is managed automatically, it's important for developers to bear the processes involved in mind in order to write code that enables the garbage collector to work correctly.
In the next chapter, we will look at different aspects of the environment API in more detail so that we can learn about some of the less commonly used features...