Posts

Key ES6 JavaScript Features Template Literals and Modern Syntax MCQs

Key ES6+ JavaScript Features Template Literals and Modern Syntax

1. Which symbol is used to define a template literal in ES6?

2. What is the purpose of default parameters in JavaScript functions?

3. Which ES6 feature allows extracting values from an object into separate variables?

4. Which statement is true regarding let and const in ES6?

5. Which feature of arrow functions differentiates them from regular functions?

6. Which syntax is correct for embedding a variable in a template literal?

7. What is the purpose of the spread operator in JavaScript?

8. Which statement is true about variables declared with const?

9. What does the rest parameter (...) do in a function?

10. Which syntax correctly uses destructuring to assign values from an object?

11. How do template literals improve handling multi-line strings in JavaScript?

12. Which syntax uses array destructuring to assign variables?

13. What value is assigned to the parameter 'x' in function test(x=5) if no argument is passed?

14. Which of the following is a use of the rest operator (...)?

15. How does 'this' behave in arrow functions?

16. What does the spread operator (...) allow when used with arrays?

17. How do template literals allow embedding expressions within strings?

18. Where are let and const variables accessible?

19. Why might arrow functions be unsuitable for methods requiring a dynamic 'this' reference?

20. How can destructuring with rest syntax be used to collect remaining elements in an array?

Post a Comment

Your comment will be visible after approval.
© TechTestLog. All rights reserved. Premium By Raushan Design
//My script