• Tutorials
  • Courses
  • Tracks

JavaScript Course | Practice Quiz-1

Last Updated :
Discuss
Comments

Question 1

What is the function of the bind method
  • 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

Which of the following are important features of javascript
  • dynamic
  • Single threaded
  • Garbage collection
  • All of the above

Question 4

The correct syntax of IIFE is
  • (function (){ // Function Logic Here. })();
  • function (){ // Function Logic Here. }();
  • function (){ // Function Logic Here. }
  • All of the above

Question 5

Which of the following is true about IIFE’s
  • 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

What does IIFE stands for in javascript
  • Invoked Immediately Functions Expressions
  • Immediately Invoked Functions Expressions
  • Both a and b
  • None of the above

Question 7

What will be the output of the following code:

let person = {

name: "Alex",

greet: function() {

console.log("Hello, " + this.name);

}

};

let greetFunc = person.greet;

greetFunc();


  • Hello, Alex

  • Hello, undefined

  • Error

  • 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.

Take a part in the ongoing discussion