JavaScript Course | Practice Quiz-1

Last Updated :
Discuss
Comments

Question 1

What is the function of the bind method
  • A
    bind an object to a common function, so that the function gives different result when its need
  • B
    Bind two different objects into one
  • C
    Both a and b
  • D
    None of the above

Question 2

What does high level mean in the context of javascript

  • A

    Developers don't need to manage resources manually. Everything happens Automatically

  • B

    The mechanism in js automatically removes unnecessary things from the memory

  • C

    Functions are simply treated as variables

  • D

    None of the above

Question 3

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

Question 4

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

Question 5

Which of the following is true about IIFE’s
  • A
    IIFEs have their own scope i.e. the variables you declare in the Function Expression will not be available outside the function.
  • B
    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.
  • C
    IIFEs can also have parameters
  • D
    All of the above

Question 6

What does IIFE stands for in javascript
  • A
    Invoked Immediately Functions Expressions
  • B
    Immediately Invoked Functions Expressions
  • C
    Both a and b
  • D
    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();


  • A

    Hello, Alex

  • B

    Hello, undefined

  • C

    Error

  • D

    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);

  • A

    No output

  • B

    ABC

  • C

    Can’t say

  • D

    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(); 

  • A

    No output

  • B

    ABC

  • C

    Can’t say

  • D

    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(); 

  • A

    No output

  • B

    ABC 

  • C

    Can’t say

  • D

    None of the above

There are 77 questions to complete.

Take a part in the ongoing discussion