Skip to content

Instantly share code, notes, and snippets.

View joshmarinacci's full-sized avatar
💭
energized

Josh Marinacci joshmarinacci

💭
energized
View GitHub Profile
@cowboy
cowboy / bad-bad-bad.js
Created October 15, 2011 14:44
Shitty destructors for JavaScript!
function Thing(context, name) {
this.context = context;
this.name = name;
this.init();
this.startTheWorstGarbageCollectorEver();
}
Thing.prototype.startTheWorstGarbageCollectorEver = function() {
var id = setInterval(function() {
if (!this.context[this.name]) {