Skip to content

Instantly share code, notes, and snippets.

Avatar

Michał Gołębiowski-Owczarek mgol

View GitHub Profile
View hook-with-support-test.js
hooks.method = function() {
if (supportTestPasses()) {
delete hooks.method;
return;
}
hooks.method = function () {
// current hook code here
}
return hooks.method();
};
@mgol
mgol / undefinedMutability.js
Created Apr 10, 2013
Show's what the EcmaScript 5 undefined immutability really means.
View undefinedMutability.js
(function ( undefined ) {
console.log( '0: ' + undefined );
})( 0 ); // => 0
(function ( undefined ) {
'use strict';
console.log( '1: ' + undefined );
})( 1 ); // => 1
(function () {
You can’t perform that action at this time.