Garbage collection is the cleaning up and reclaiming of memory that reserved by a program. With some languages, you must write code that deletes a variable or object after you are through with it in order to free the memory for use by other programs. Javascript automatically knows when your program no longer needs a variable or object and automatically cleans up memory for you.