Follow @davidshariff

Choose Either:

Start From The Beginning

OR

Start From Question

JavaScript Web Quiz

2 people completed this quiz and the average score was: 50%

Start »

By David Shariff

Read My Blog

var foo = function foo() {
    console.log(foo === foo);  
};
foo();

What is printed in the console?

  • true
  • false
  • ReferenceError
function aaa() {
    return
    {
        test: 1
    };
}
alert(typeof aaa());

What does the above alert?

  • function
  • number
  • object
  • undefined
Number("1") - 1 == 0;

What is the result?

  • true
  • false
  • TypeError
(true + false) > 2 + true;

What is the result?

  • true
  • false
  • TypeError
  • NaN
function bar() {
    return foo;
    foo = 10;
    function foo() {}
    var foo = '11';
}
alert(typeof bar());

What is alerted?

  • number
  • function
  • undefined
  • string
  • Error
"1" - - "1";

What is the result?

  • 0
  • 2
  • 11
  • "11"
var x = 3;

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

var go = foo.baz.bar;

alert(go());
alert(foo.baz.bar());

What is the order of values alerted?

  • 1, 2
  • 1, 3
  • 2, 1
  • 2, 3
  • 3, 1
  • 3, 2
new String("This is a string") instanceof String;

What is the result?

  • true
  • false
  • TypeError
[] + [] + 'foo'.split('');

What is the result?

  • "f, o, o"
  • TypeError
  • ["f", "o", "o"]
  • [][]["f", "o", "o"]
new Array(5).toString();

What is the result?

  • ",,,,"
  • []
  • "[]"
var myArr = ['foo', 'bar', 'baz'];
myArr.length = 0;
myArr.push('bin');
console.log(myArr);

What is printed in the console?

  • ['foo', 'bar', 'baz']
  • ['foo', 'bar', 'baz', 'bin']
  • ['bin', 'foo', 'bar', 'baz']
  • ['bin']
String('Hello') === 'Hello';

What is the result?

  • true
  • false
  • TypeError
var x = 0;
function foo() {
    x++;
    this.x = x;
    return foo;
}
var bar = new new foo;
console.log(bar.x);

What is printed on the console?

  • ReferrenceError
  • TypeError
  • undefined
  • 0
  • 1
"This is a string" instanceof String;

What is the result?

  • true
  • false
  • TypeError
var bar = 1,
    foo = {};

foo: {
    bar: 2;
    baz: ++bar;
};
foo.baz + foo.bar + bar;

What is the result?

  • ReferenceError
  • TypeError
  • undefined
  • NaN
  • 4
  • 5
var myArr = ['foo', 'bar', 'baz'];
myArr[2];
console.log('2' in myArr);

What is the result of console.log?

  • true
  • false
  • ReferenceError
var arr = [];
arr[0]  = 'a';
arr[1]  = 'b';
arr.foo = 'c';
alert(arr.length);

What value is alerted?

  • 1
  • 2
  • 3
  • undefined
10 > 9 > 8 === true;

What is the result?

  • true
  • false
function foo(a, b) {
    arguments[1] = 2;
    alert(b);
}
foo(1);

What value is alerted?

  • 2
  • undefined
  • ReferenceError
NaN === NaN;

What is the result?

  • true
  • false
  • TypeError

You Scored: x%

The average score for this quiz was: 50%

Share Your Score:

Want to learn more? Check out my new eBook:

How to Become an Advanced Front End Developer

Or Fancy Another Quiz?

Try the Front End Web Development Quiz

Blog @davidshariff

Continue »