Fork me on GitHub
0
marathon javascript quiz - free online test

999

            !!0
            

Type_conversion - +"1", +new Date, Number("1")

999

            var str = "305 794";
            var arr = str.match(/\w+/g);
            typeof arr[0];
            
999

            var str = "102";
            var numb = parseInt ( str.split("").reverse().toString() );
            console.log ( numb );
            

  parseInt( str.split("").reverse().toString().replace(/,/g, "") ); 
999

            var isFloat = "1.1"
            if ( isFloat % 1  ) { true; }
            else  { false; }

            

999

            parseFloat ( "10.001", 8 ).toPrecision(4);
            

999

            var a = [1,2,3];
            var b = a.slice(0);
            console.log ( a == b );
            

var new_array_2 = [].concat(old_array);
999

            Infinity > NaN;
            

http://ferrante.pl/frontend/javascript/quiz-javascript/
999

            "" + [1] + {};
            

http://ferrante.pl/frontend/javascript/quiz-javascript/
999

            [10, 100, 1][~"2" + + "3"];
            

http://ferrante.pl/frontend/javascript/quiz-javascript/
999

            var s = [s+3];
            s;
            

999

            ~~"3.14";
            

999

            ~"3.14";
            

999

            0.3 === 0.1 + 0.2;
            

https://github.com/nathansmith/javascript-quiz/blob/master/ANSWERS.md
999

            parseInt("010");
            

Old bug! Fixed in Chrome :)
999

            var x = 2, y = 3;
            console.log (x++-++y+x++); 
            

999

            var x = "21", y = "200);
            console.log (x < y); 
            

999

            "abc" < "abd"
            

999

            (100).toString().length == (101['toString'])()['length']
            

999

            var x = (1,5 - 1) * 2;
            

999

            "abc" < "abd"
            

999

            var b = 10,
            c = (
                20,
                function (x) { return x + 100},
                function () { return arguments[0]}
            );
            a = b + c
            ({x: 10}).x
            

ECMA-262 by Dymitry
999

            (function(){
                return typeof arguments;
            })();
            

The Module Pattern approach http://benalman.com/news/2010/11/immediately-invoked-function-expression/

999

            var f = function g(){ return 23; };
            typeof g();
            

Functions invocation http://yehudakatz.com/2011/08/11/understanding-javascript-function-invocation-and-this/

999

            (function(x){
                delete x;
                return x;
            })(1)
            

Explanation soon

999

            var y = 1, x = y = typeof x;
            x;
            

Explanations

999

            (function f(f){
                return typeof f();
            })(function(){ return 1; });
            

(f) is a function so invoking typeof f() give a number, so nuber will be returned

6

            var foo = {
                bar: function() { return this.baz; },
                baz: 1
            };
            (function(){
                return typeof arguments[0]();
            })(foo.bar);
            

(function(){ console.log (arguments[0]);return typeof arguments[0].call(foo);})(foo.bar);
999

            var foo = {
                bar: function(){ return this.baz; },
                baz: 1
            }
          typeof (f = foo.bar)();
            

Explanations

999

          var f = (function f(){ return "1"; }, function g(){ return 2; })();
          typeof f;
            

http://imbuzu.wordpress.com/2012/11/03/the-lazy-function-declaration-pattern-javascript/
999

            var x = 10;
            var foo = {
              x: 20,
              bar: function () {
                var x = 30;
                return this.x;
              }
            };
             
            console.log(
              foo.bar(),
              (foo.bar)(),
              (foo.bar = foo.bar)(),
              (foo.bar, foo.bar)()
            );

            

http://imbuzu.wordpress.com/2012/11/03/the-lazy-function-declaration-pattern-javascript/
999

            function(){ function(){return true;}  };
            

http://imbuzu.wordpress.com/2012/11/03/the-lazy-function-declaration-pattern-javascript/
9

            var x = 1;
            if (function f(){}) {
                x += typeof f;
            }
            x;
            

!(function u(){}); typeof typeof x

999

          var x = [typeof x, typeof y][1];
          typeof typeof x;
            

typeof typeof x
999

            (function(foo){
               return typeof foo.bar;
            })({ foo: { bar: 1 } });
            

http://clubajax.org/javascript-context-call-and-bind-ninja-level/

12

            (function f(){
               function f(){ return 1; }
               return f();
               function f(){ return 2; }
            })();
            

Explanations

13

            function f(){ return f; }
            new f() instanceof f;
            

Explanations

999

            with (function(x, undefined){}) length;