CARVIEW |
JavaScript Course | Practice Quiz-1
Question 1
- bind an object to a common function, so that the function gives different result when its need
- Bind two different objects into one
- Both a and b
- None of the above
Question 2
What does high level mean in the context of javascript
Developers don't need to manage resources manually. Everything happens Automatically
The mechanism in js automatically removes unnecessary things from the memory
Functions are simply treated as variables
None of the above
Question 3
- dynamic
- Single threaded
- Garbage collection
- All of the above
Question 4
- (function (){ // Function Logic Here. })();
- function (){ // Function Logic Here. }();
- function (){ // Function Logic Here. }
- All of the above
Question 5
- IIFEs have their own scope i.e. the variables you declare in the Function Expression will not be available outside the function.
- Similar to other functions IIFEs can also be named or anonymous, but even if an IIFE does have a name it is impossible to refer/invoke it.
- IIFEs can also have parameters
- All of the above
Question 6
- Invoked Immediately Functions Expressions
- Immediately Invoked Functions Expressions
- Both a and b
- None of the above
Question 7
What will be th output of the following code //object geeks1 var geeks1 = { name : "ABC", article: "C++" } //object geeks2 var geeks2 = { name : "CDE", article: "JAVA" } //object geeks3 var geeks3 = { name : "IJK", article: "C#" } function printVal(){ document.write(this.name+" contributes about "+this.article+"<br>"); } var printFunc2= printVal.bind(geeks1); //using bind() // bind() takes the object "geeks1" as parameter// printFunc2(); var printFunc3= printVal.bind(geeks2); printFunc3(); var printFunc4= printVal.bind(geeks3); printFunc4(); //uniquely defines each objects
ABC contributes about C++ CDE contributes about JAVA IJK contributes about C#
ABC contributes about C++ No output IJK contributes about C#
ABC contributes about C++ CDE contributes about JAVA No output
None of the above
Question 8
What will be the output of the following code:
var geeks = {
name : "ABC",
printFunc: function(){
console.log(this.name);
}
}
var printFunc2 = geeks.printFunc.bind(geeks);
No output
ABC
Can’t say
None of the above
Question 9
What will be the output of the following code:
let geeks = {
name : "ABC",
printFunc: function() {
console.log(this.name);
}
}
let printFunc2 = geeks.printFunc;
printFunc2();
No output
ABC
Can’t say
None of the above
Question 10
What will be the output of the following code:
let geeks = {
name : "ABC",
printFunc: function() {
console.log(this.name);
}
}
let printFunc2 = geeks.printFunc;
printFunc2();
No output
ABC
Can’t say
None of the above
There are 77 questions to complete.