Skip to content

Instantly share code, notes, and snippets.

@chaffeqa
Created April 15, 2016 02:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chaffeqa/a87ab05c20a2909e7b0743f438a16ab9 to your computer and use it in GitHub Desktop.
Save chaffeqa/a87ab05c20a2909e7b0743f438a16ab9 to your computer and use it in GitHub Desktop.
Candidate Questions
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))
(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?
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