Memory management in Javascript
Memory management means how the memory is allocated, used and cleared. As we can see it has 3 steps. Memory allocation: Memory is allocated by the operating system . Memory usage: Read/write operations are performed in the allocated memory. Memory de-allocation: Memory is released. In languages like C, we have malloc( ) and free() to allocate and deallocate memory. So along with taking care of the solving the business problem, managing data structures, developers also have to take care of memory allocation and deallocation. In Javascript, memory allocation and deallocation happens implicitly. For instance, when a variable is declared, some memory is allocated in the heap. When the variable is not required anymore, javascript has a process called garbage collection, which frees the memory. This automatic memory management nature of javascript can make the developer get a false impression that it is not required to care about memory managem...