JavaScript Memory Leaks Explained with Simple Examples