Skip to content

Instantly share code, notes, and snippets.

View lazywithclass's full-sized avatar

Alberto Zaccagni lazywithclass

View GitHub Profile
@lazywithclass
lazywithclass / gist:1817884
Created February 13, 2012 16:06
Javascript quiz question 1
(function(){
return typeof arguments;
})();
@lazywithclass
lazywithclass / gist:1817948
Created February 13, 2012 16:16
Javascript quiz question 2
var f = function g(){ return 23; };
typeof g();
@lazywithclass
lazywithclass / gist:1818104
Created February 13, 2012 16:48
Javascript quiz question 3
(function(x){
delete x;
return x;
})(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:1818289
Created February 13, 2012 16:59
Javascript quiz question 4
var y = 1, x = y = typeof x;
x;
@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: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:1825485
Created February 14, 2012 10:09
Javascript quiz question 9
var x = 1;
if (function f(){}) {
x += typeof f;
}
x;
@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:1827967
Created February 14, 2012 16:35
Javascript quiz question 10
var x = [typeof x, typeof y][1];
typeof typeof x;