Javascript Challenges

Variable Scope

We have the following code:

var name = 'John',
    obj = {
        name: 'Mary',
        whoIam: function() {
            var name = 'James';

            console.log( this.name );

            setTimeout( function () {
                console.log( this.name );
            }, 100 );
        }
    };

obj.whoIam();

Exercise

Correct!
False!

What does it prints?

Exercise

Correct!
False!

Why?