Created
April 15, 2016 02:33
-
-
Save chaffeqa/a87ab05c20a2909e7b0743f438a16ab9 to your computer and use it in GitHub Desktop.
Candidate Questions
This file contains hidden or 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 meth1(){ | |
return 1; | |
} | |
function meth2(input){ | |
return 2 + input; | |
} | |
function result(arg1, cb){ | |
var result = typeof(cb) == "function" && cb(arg1) | |
return result | |
} | |
console.log('a'+result(1,meth1())) | |
console.log('b'+result(1,meth1)) | |
console.log('C'+result(1,meth2)) |
This file contains hidden or 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() { | |
var a = b = 5; | |
})(); | |
console.log(b); | |
// What will be printed on the console? | |
(function(a,b,c) { | |
console.log(a,b,c) | |
})(window, document); | |
// What will be printed on the console? | |
(function f(f){ | |
return typeof f(); | |
})(function(){ return 1; }); | |
// what is the result? |
This file contains hidden or 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
var fullname = 'John Doe'; | |
var obj = { | |
fullname: 'Colin Ihrig', | |
prop: { | |
fullname: 'Aurelio De Rosa', | |
getFullname: function() { | |
return this.fullname; | |
} | |
} | |
}; | |
console.log(obj.prop.getFullname()); | |
var test = obj.prop.getFullname; | |
console.log(test()); | |
// What is the result of the following code? | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment