Skip to content

Instantly share code, notes, and snippets.

@vird
Created June 1, 2014 19:27
Show Gist options
  • Save vird/0932cd197f912a6c6485 to your computer and use it in GitHub Desktop.
Save vird/0932cd197f912a6c6485 to your computer and use it in GitHub Desktop.
var adapter;
adapter = {};
adapter.destroy = function() {
var _i, _len, _ref, adapter;
_ref = [1, 2, 3];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
adapter = _ref[_i];
adapter = null;
}
};
adapter.destroy();
console.log(adapter);
adapter={}
adapter.destroy = ()->
for adapter in [1,2,3]
adapter = null # this will destroy variable not in scope
return
adapter.destroy()
console.log adapter
var adapter;
adapter = {};
adapter.destroy = function() {
var _i, _len, _ref;
_ref = [1, 2, 3];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
adapter = _ref[_i];
adapter = null;
}
};
adapter.destroy();
console.log(adapter);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment