Profile Picture
IT Made Easy
The site provides some rough IT Notes that make your life easier. The site currently has notes on HTML, CSS, Regex, OOPS, JS, JQuery, PHP, Java, ASP.NET, C#, Database, Linux, URL Rewrite, SEO, Project Management and Hosting. Please do share this site if you like.

Closure and Memory Leaks

  • Returning a function literal created as an internal object within another function, and assigning it to a variable in the calling application, is known as closure in JavaScript

function leakMemory(   ) {

  var el = document.getElementById('el');

  var o = { 'el': el };

  el.o = o;


  • Accidental closure can create memory leaks as above

IT Notes

by VinodSebastian

IT Downloads