Last active
December 26, 2015 10:29
-
-
Save vernonk/22b6a038e41c479b0059 to your computer and use it in GitHub Desktop.
JavaScript Questions
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
// Why would you need this? | |
function hasHair () { | |
var args = Array.prototype.slice.call( arguments ); | |
} |
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 output values do these console.log statements give you? | |
console.log( typeof isAwesome ); | |
console.log( typeof lovesJava ); | |
console.log( typeof isHired ); | |
function isAwesome () { return true; } | |
window.lovesJava = function () { return false; }; | |
var isHired = function () { return true; }; |
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 is the result of the invocation of sayHi within the greeting function? | |
// Why? | |
function greeting () { | |
sayHi( "Paul" ); | |
return; | |
function sayHi ( name ) { | |
console.log( "Hi", name ); | |
} | |
} |
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
A series of JavaScript related questions to be used during technical interviews. |
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
function isAwesome () { | |
console.log( this ); | |
} | |
var Person = function () { | |
console.log( this ); | |
}; | |
var obj = {}; | |
// What is the context of `this` in the following scenarios? | |
var jon = Person(); | |
var terence = new Person(); | |
isAwesome(); | |
isAwesome.bind( obj )(); | |
isAwesome.call( obj ); | |
isAwesome.apply( this ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment