Skip to content

Instantly share code, notes, and snippets.

View mgol's full-sized avatar

Michał Gołębiowski-Owczarek mgol

View GitHub Profile
hooks.method = function() {
if (supportTestPasses()) {
delete hooks.method;
return;
}
hooks.method = function () {
// current hook code here
}
return hooks.method();
};
@mgol
mgol / undefinedMutability.js
Created April 10, 2013 16:41
Show's what the EcmaScript 5 undefined immutability really means.
(function ( undefined ) {
console.log( '0: ' + undefined );
})( 0 ); // => 0
(function ( undefined ) {
'use strict';
console.log( '1: ' + undefined );
})( 1 ); // => 1
(function () {