ECMAScript6 | Fresco Play

ECMAScript6 | Fresco Play

Monday, May 22, 2023
~ 7 min read
ECMAScript6 | Fresco Play

Question 1: ES6 is the implementation of?

Answer: ECMAScript


Question 2: All major JavaScript Implementations are based on which standard?

Answer: ECMAScript


Question 3: ES6 is officially called _

Answer: ECMA Script 2015


Question 4: ECMAScript is a

Answer: Language Standard


Question 5: ES6 can be used for

Answer: Both client side and server side scription


Question 6: How many parts are there in an ES6 module?

Answer: 2


Question 7: Rest collects all variables into a single array, while "Spread" expands a single variable into multiple. - true

Answer: True


Question 8: Which of the following parameters can be used to expand a single array into multiple arguments?

Answer: Spread


Question 9: const { x, y } = { x: 11, y: 8 }; is the Same as const { x: x, y: y } = { x: 11, y: 8 };

Answer: True


Question 10: During destructuring, you can either declare variables or assign to them, or both.

Answer: False


Question 11: Which of the following parameters can be used to define indefinite number of parameters in one single array?

Answer: Rest


Question 12: What will be the output of following code snippet? function foo(a = 10, b = 5) { console.log(a, b); } foo(6);

Answer: 6,5


Question 13: The following code implements the ______ feature of ES6

Answer: spread


Question 14: Destructuring helps us to extract multiple values from an object via

Answer: Object Pattern


Question 15: Template literals can be defined as

Answer: multi-line string literals that support interpolation


Question 16: What will be the output of the following code snippet? const func= ( x, y ) => { return x + y; }; func(11,12);

Answer: 23


Question 17: Arrow Functions are less verbose than traditional functions

Answer: True


Question 18: Template literals support

Answer: interpolation


Question 19: Template literals can be reused

Answer: True


Question 20: Instead of using single quotes or double quotes, es6 uses BACKTICK or OPENQUOTE ( " ` " ) character to create destructuring pattern.

Answer: False


Question 21: Variables declared in a scope are accessible in

Answer: All scopes nested inside it


Question 22: In Arrow functions, if there is only one parameter and that parameter is an identifier then the parentheses can be omitted.

Answer: True


Question 23: Which is not a lexical inside arrow functions?

Answer: None


Question 24: Template literals does not allow us to _

Answer: build complex html and xml templates.


Question 25: Select the wrong code Snippet

Answer: const func1 = (x, y) => { return x + y; };


Question 26: Which keywords can be used to implement inheritance in ES6?

Answer: extends


Question 27: _ feature helps us to simplify the inheritance concept.

Answer: classes


Question 28: The bodies of class declarations and class expressions are executed in strict mode. - true

Answer: True


Question 29: Which is not true about constructor in ES6?

Answer: A class may have any number of constrcutors


Question 30: Which is not true about static methods?

Answer: Static methods can be directly called with the help of a class object.


Question 31: Sets can be used to store

Answer: Heterogeneous data


Question 32: We can use this data-type to avoid repetitions.

Answer: sets


Question 33: Map can use _______ value as Key.

Answer: any


Question 34: Maps can be used to store

Answer: Key - value pairs


Question 35: Symbols can be created using the factory function

Answer: Symbol()


Question 36: What will be the output of this code? var sym = new Symbol();

Answer: Syntax Error


Question 37: What will be printed if the following code is executed? let x=150; if(x>100) { x=1; } console.log(x);

Answer: True


Question 38: Objects declared as "const" are immutable.

Answer: False


Question 39: What is the meaning of the following line of code? const pi=3.14;

Answer: Const turns variables into constants, and they can’t be changed.


Question 40: Declaring variables with which of the following keywords, will make the variable immutable?

Answer: const


Question 41: A Promise has _________ number of states.

Answer: 3


Question 42: What is the scope of the variable "a" in function below? function val(x){ if(x>0){ let a = x; console.log(a); } }

Answer: block


Question 43: Variables declared with which of the following constructs do not have block scope?

Answer: const


Question 44: Keyword "let" allows redeclaring variables. - FALSE

Answer: False


Question 45: Which of the following statements is not true about level of scope?

Answer: I & III are true and II and IV are false.


Question 46: I. let keyword declares a block scoped variable.

Answer: nan


Question 47: II. var keyword declares a block scoped variable.

Answer: nan


Question 48: III. const keyword declares a block scoped variable.

Answer: nan


Question 49: IV. let and const are similiar to each other.

Answer: nan


Question 50: What is the significance of the following code snippet? for (let i = 0; i < 10; i++) { x += 10; }

Answer: The variable i is valid only inside the for loop


Question 51: Which of the following does not declare a block scoped variable?

Answer: var


Question 52: Promise reactions are callbacks that you register with the Promise method then(), to be notified of a fulfillment or a rejection.

Answer: True


Question 53: What if promise2 get rejected in the following syntax? Promise.all(promise1, promise2, .....)

Answer: It will reject the entire set


Question 54: Which method can be used to retrieve symbols from the global symbols registry?

Answer: Symbol.keyfor()


Question 55: Which of the following is not a state of Promise?

Answer: Approved


Question 56: It is always a good practice to physically separate the code based on

Answer: Functionality


Question 57: ES6 modules are stored in

Answer: files


Question 58: A JavaScript module is a file that exports something for other modules to consume.

Answer: True


Question 59: Using yield(), Generators can receive input from _________.

Answer: next()


Question 60: What will be the output of following code snippet? const cart =Object.freeze({ name: 'Dove', price: '4.50' }); cart.price = '5.10' ; console.log(cart);

Answer: Uncaught TypeError


Question 61: A generator can pause itself using the keyword __________.

Answer: yield


Post a comment

Comments

Join the conversation and share your thoughts! Leave the first comment.

Get your FREE PDF on "100 Ways to Try ChatGPT Today"

Generating link, please wait for: 60 seconds

Checkout all hot deals now πŸ”₯

Search blogs

No blog posts found