On Github khan4019 / explainJSQuiz
(function(){ return typeof arguments; })();
Array instanceof Object; //true
typeof []; //object
//arguments are like array arguments.length; arguments[3]; arguments[3] = 45;
arguments.push(21); //TypeError: Object has no method 'push'
typeof arguments; //"object"
(function(){ return typeof arguments; })(); //"object"
var f =function g(){ return 23; }; typeof g();Answer: GitHub gist: Nigam
(function(x){ delete x; return x; })(1);Answer: Github gist: Nate
var y = 1, x = y = typeof x; x;
var x; x; //undefined window.kkkk; //undefined
typeof undefined; //"undefined"
var x; typeof x; //"undefined"
var x = typeof x; x; //"undefined"
var y = 1, x = y = typeof x; x; //"undefined"js: expression
(function f(f){ return typeof f(); })(function(){ return 1; });
function foo(f){ return f; } foo(2); //2 foo(myFunc); //myFunc
fucntion abc(){ return 1; } function foo(f){ return f(); } foo(abc); //1;
(function f(f){ return typeof f(); })(function(){ return 1; }); //"number"
var foo = { bar: function() { return this.baz; }, baz: 1 }; (function(){ return typeof arguments[0](); })(foo.bar);Answer: alternate answer
var foo = { bar: function() { return this.baz; }, baz: 1 };
foo.bar(); //1
var kkk = foo.bar; kkk; //function(){ // return this.baz; //}
kkk(); //undefined
var foo = { bar: function() { return this.baz; }, baz: 1 }; (function(){ return typeof arguments[0](); })(foo.bar);
//"undefined"
var foo = { bar: function(){ return this.baz; }, baz: 1 } typeof (f = foo.bar)();Answer: GitHub gist: Dean
var f = (function f(){ return "1"; }, function g(){ return 2; })(); typeof f;
var x = 1; if (function f(){}) { x += typeof f; } x;Answer: GitHub gist: Jason
var x =[typeof x, typeof y][1]; typeof typeof x;
//if not declared //or declared not assigned //things are undefined typeof y; //"undefined"
[typeof x, typeof y][1]; //"undefined"
var x =[typeof x, typeof y][1]; x; //"undefined"
typeof "undefined"; //"string"
typeof "string"; //"string"
var x =[typeof x, typeof y][1]; typeof typeof x; //"string"
(function(foo){ return typeof foo.bar; })({ foo: { bar: 1 } });
var foo = { foo: { bar: 1 } }
foo.foo.bar; //1 foo.bar; //undefined
function abc(foo){ return foo.bar; } abc(); //undefined
typeof undefined; //"undefined"
(function(foo){ return typeof foo.bar; })({ foo: { bar: 1 } }); //"undefined"
(function f(){ function f(){ return 1; } return f(); function f(){ return 2; } })();Answer: GitHub gist: Steve
function f(){ return f; } new f() instanceof f;
with (function(x, undefined){}) length;