This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// What happens when you execute the code below | |
a = 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// What does the below code print out? | |
console.log(this); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// What does the below code print out? | |
"use strict"; | |
(function (){ | |
console.log(this); | |
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// What does the below code print out? | |
"use strict"; | |
var animal = { | |
kind: "Cow", | |
which: function () { | |
console.log(this.kind); | |
} | |
}; | |
animal.which(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// What does the below code print out? | |
"use strict"; | |
var animal = { | |
kind: "Cow", | |
which: function () { | |
console.log(this.kind); | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// What does the below code print out? | |
"use strict"; | |
function sayHello(last_name) { | |
console.log("Hello " + this + " " + last_name); | |
} | |
sayHello("Hussain"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// What does the below code print out? | |
"use strict"; | |
function sayHello(last_name) { | |
console.log("Hello " + this + " " + last_name); | |
} | |
sayHello.call("Asim", "Hussain"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// What does the below code print out? | |
"use strict"; | |
function sayHello(last_name) { | |
console.log("Hello " + this + " " + last_name); | |
} | |
sayHello.apply("Asim", ["Hussain"]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// What does the below code print out? | |
"use strict"; | |
function sayHello(last_name) { | |
console.log("Hello " + this + " " + last_name); | |
}.bind("Asim"); | |
sayHello("Hussain"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// What does the below code print out? | |
"use strict"; | |
var sayHello = function(last_name) { | |
console.log("Hello " + this + " " + last_name); | |
}.bind("Asim"); | |
sayHello("Hussain"); |