Aptitude Reasoning English GK Computer Knowledge Programming Skill Banking Software Testing



Question - 1

Which is not Array methods in ES6?

  • Array.of()
  • Array.from()
  • Array.prototype.find()
  • Array.copy()
Solutions
Question - 2

What is ES6?

  • Acronym of JSON And XML
  • Acronym of ECMAScript 6
  • Acronym of Ex Scripting 6
  • None Of the Above
Solutions
Question - 3

ECMAScript1 edition released in year of____

  • 1997
  • 1998
  • 1999
  • 2000
Solutions
Question - 4

What is the final value of "obj" in the following example?

const obj = { foo: 1 };
obj.bar = 2;

  • { foo: 1 }
  • { foo: 1, bar: 2 }
  • { foo: 1, 2: bar }
  • None of the above
Solutions
Question - 5

Rest is a new way for functions to handle an arbitrary number of parameters. Can you guess what the mysterious "x" variable holds?

function mys(...params) {
return params;
}
let x = mys(1,23,4);

  • "x" is undefined
  • "x" becomes [1,23,4]
  • "x" becomes "1 23 4"
  • "x" becomes 1 23 4
Solutions
Question - 6

 See the example below. Here given some interpolation features. check what is wrong.

let name = 'Marry';
let occupation = 'Farmer';
console.log(`Hi! My name is ${name}. I'm a ${occupation}.`);

  • Nothing wrong with the example. This is how the feature works in ES6.
  • The example is wrong. You can't break a String into lines in JavaScript.
  • The example is wrong. You can't embed variables in String in JavaScript.
  • None of the above.
Solutions
Question - 7

What value will this expression return?

let x, { x: y = 1 } = { x }; y;

  • { x: 1 }
  • 0
  • 1
  • undefined
Solutions
Question - 8

What is a Promise() in ES6?

  • Tool for managing asynchronous control flow. A promise represents an operation expected to complete in the future.
  • The opposite of Amateurmise().
  • Something you say, when you want someone to believe you.
  • None of the above.
Solutions
Question - 9

function* gen() { 

  

 yield;  

 

}

 

// Calling the Generator Function
var mygen = gen();
console.log(mygen.next().value);
   

  • 0
  • 1
  • undefinde
  • None of above
Solutions
Question - 10

What is/are the advantages of the arrow function?

   

  • It reduces code size.
  • The return statement is optional for a single line function.
  • Lexically bind the context.
  • All the above
Solutions
Question - 11

What is stored in the triangle array?

let point = [1,3], segment = [point,[5,5]], triangle = [...segment,[1,8]];

   

  • [ [1,3], [5,5], [1,8] ]
  • [1,3,5,5,1,8]
  • 23
  • None of the above
Solutions
Question - 12

Which one is correct using the spread operator?

let num1 = [40,50,60];

let num2 = [10,20,30,...num1,70,80,90,100];

console.log(num2);

  • [ 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 ]
  • [ 40, 50, 60 ]
  • [ 10, 20, 30, 70, 80, 90, 100 ]
  • None of these
Solutions
Question - 13

ES6 gives an alternative way to assign variables. Can you guess what the below code does?

let a = 12, b = 3;
[a, b] = [b, a];

  • Swaps the values inside a and b, without using extra variables.
  • Makes both a and b equal 12.
  • Creates an array that contains a and b.
  • None of above
Solutions
Question - 14

function show(...args) {
let sum = 0;
for (let i of args) {
sum += i;
}
console.log("Sum = "+sum);
}

show(10, 20, 30);

  • Sum = 60
  • Undefined
  • [10,20,30]
  • [60]
Solutions
Question - 15

What are the states of promises in ES6?

  • Pending
  • Fulfilled
  • Rejected
  • All the above
Solutions
Question - 16

What will the result of this expression be?

typeof (new (class F extends (String, Array) { })).substring

  • Error
  • undefined
  • object
  • function
Solutions
Question - 17

Weakmap keys must be?

  • an Object
  • a Class
  • an array
  • None of the above
Solutions
Question - 18

What do you mean by Babel?

  • Babel is a JS Transpiler
  • Babel is a JS Compiler
  • Babel is a JS Library
  • None of these
Solutions
Question - 19

How do you empty an array?

  • Array. Length = 0;
  • Array()= 0;
  • Empty( Array ) =0;
  • None of these
Solutions
Question - 20

What is IIFE?

  • Immediately invoked function expressions
  • Intermediate invoked function expressions
  • Internal invoked function expressions
  • None of these
Solutions
Tags:
ES6 MCQ (Multiple Choice Questions), Advanced ES6 MCQ, ES6 MCQ Online test,ES6 MCQ Questions and answers PDF, ES6 Interview Questions With Answers, ES6 Technical Questions with full explanation