Skip to content

Instantly share code, notes, and snippets.

View lazywithclass's full-sized avatar

Alberto Zaccagni lazywithclass

View GitHub Profile
@lazywithclass
lazywithclass / gist:1818328
Created February 13, 2012 17:05
Javascript quiz question 5
(function f(f){
return typeof f();
})(function(){ return 1; });
@lazywithclass
lazywithclass / gist:1818350
Created February 13, 2012 17:08
Javascript quiz question 6
var foo = {
bar: function() { return this.baz; },
baz: 1
};
(function(){
return typeof arguments[0]();
})(foo.bar);
@lazywithclass
lazywithclass / gist:1818743
Created February 13, 2012 18:09
Javascript quiz question 7
var foo = {
bar: function(){ return this.baz; },
baz: 1
}
typeof (f = foo.bar)();
@lazywithclass
lazywithclass / gist:1825452
Created February 14, 2012 10:02
Javascript quiz question 8
var f = (function f() {
return "1";
}, function g() {
return 2;
})();
typeof f;
@lazywithclass
lazywithclass / gist:1825485
Created February 14, 2012 10:09
Javascript quiz question 9
var x = 1;
if (function f(){}) {
x += typeof f;
}
x;
@lazywithclass
lazywithclass / gist:1827967
Created February 14, 2012 16:35
Javascript quiz question 10
var x = [typeof x, typeof y][1];
typeof typeof x;
@lazywithclass
lazywithclass / gist:1827987
Created February 14, 2012 16:38
Javascript quiz question 11
(function(foo){
return typeof foo.bar;
})({ foo: { bar: 1 } });
@lazywithclass
lazywithclass / gist:1836323
Created February 15, 2012 14:49
Javascript quiz question 12
(function f(){
function f(){ return 1; }
return f();
function f(){ return 2; }
})();
@lazywithclass
lazywithclass / gist:1836326
Created February 15, 2012 14:50
Javascript quiz question 13
function f(){ return f; }
new f() instanceof f;
@lazywithclass
lazywithclass / gist:1836327
Created February 15, 2012 14:50
Javascript quiz question 14
with (function(x, undefined) {
}) length;