Home ES6+ Tutorials ES6+ Quiz ES6+ Quiz (50 Questions) Answer all questions, track your progress live, and see your final ES6+ quiz score at the end. Progress 0 / 50 answered Q1. What does ES6+ mainly refer to in modern JavaScript? Only CSS features ES6 and newer JavaScript language features HTML form validation only Database query syntax Q2. Which keyword creates a block-scoped variable that can be reassigned? var let const static Q3. Which keyword creates a block-scoped variable that cannot be reassigned? let var const final Q4. What is the main scope difference between var and let? var is block-scoped let is function-scoped let is block-scoped There is no difference Q5. Which syntax creates an arrow function? function => () () => {} => function() arrow function() Q6. What is a key limitation of arrow functions? They cannot be used as constructors They always return objects They cannot accept parameters They only work in classes Q7. Which syntax creates a template literal? "Hello ${name}" 'Hello ${name}' `Hello ${name}` (Hello ${name}) Q8. Which operator is used for optional chaining? ?? ?. ... => Q9. Which operator returns the right value only for null or undefined? || && ?? === Q10. Which operator assigns only when the left value is nullish? ||= &&= ??= += Q11. What does the spread operator do with an array? Sorts the array Expands elements outward Deletes duplicate values Converts array to object Q12. What does a rest parameter do in a function? Expands values into arguments Collects remaining arguments into an array Deletes unused parameters Creates a Promise Q13. Which destructuring syntax extracts object properties? [a, b] { a, b } (a, b) <a, b> Q14. Which ES6 feature lets you define methods directly inside object literals? Method shorthand Arrow binding Class export Module scope Q15. Which method copies enumerable properties into a target object? Object.copy() Object.assign() Object.merge() Object.clone() Q16. Which method returns an array of [key, value] pairs from an object? Object.keys() Object.values() Object.entries() Object.pairs() Q17. Which keyword defines a JavaScript class? object prototype class model Q18. Which method runs when a new class instance is created? init() constructor() create() setup() Q19. Which keyword creates inheritance between classes? inherits extends superclass prototype Q20. What must be called in a child class constructor before using this? this.init() super() extends() parent() Q21. Which prefix marks a private class field in modern JavaScript? _ # $ @ Q22. Where are static methods defined? On instances only On the class itself Inside constructors only In modules only Q23. Which syntax exports a value from an ES module? module.send() export provide expose Q24. Which attribute loads JavaScript as an ES module in the browser? type="text/javascript" type="module" async="module" rel="module" Q25. What are the three Promise states? Open, closed, waiting Pending, fulfilled, rejected Start, stop, pause Loading, success, error only in syntax Q26. Which Promise method handles success? .catch() .then() .finally() .resolve() Q27. What does Promise.all() do? Returns the first settled Promise Waits for all Promises to fulfill Ignores rejected Promises Runs Promises sequentially only Q28. Which method waits for every Promise and reports all outcomes? Promise.race() Promise.any() Promise.allSettled() Promise.first() Q29. Which method resolves with the first fulfilled Promise? Promise.all() Promise.race() Promise.any() Promise.allSettled() Q30. Which keywords make async code look more like synchronous code? then and catch async and await yield and return import and export Q31. What does an async function always return? A string A Promise undefined An array Q32. Which collection stores unique values only? Map Set Array Object Q33. Which collection stores key-value pairs with any key type? Set Array Map String Q34. Which method checks whether an array contains a value? indexOf() only includes() has() contains() Q35. Which array method returns a new array after transforming each item? filter() map() find() some() Q36. Which array method returns items that pass a test? map() reduce() filter() forEach() Q37. Which array method reduces an array to a single value? map() reduce() flat() sort() Q38. Which method flattens nested arrays by one level by default? flat() flatMap() spread() merge() Q39. What is a higher-order function? A function with high performance only A function that takes or returns another function A function that runs only once A function inside a class only Q40. Which data type creates unique primitive identifiers? String Number Symbol Boolean Q41. Which object intercepts operations like get and set? Reflect Proxy Map Set Q42. Which object provides default methods matching Proxy traps? Object Reflect JSON Math Q43. Which type is used for very large integers? Number BigInt Float Long Q44. How do you create a BigInt literal? 100L 100n Big(100) int100 Q45. Which operator performs exponentiation? ^ ** ^^ pow Q46. Which feature allows await at the top level of a module? Top-level await Global async Module pause Await export Q47. Which function creates values over time using yield? Generator function Arrow function Callback function Static function Q48. What does Babel mainly help with for modern JavaScript? Styling components Transpiling newer syntax for older environments Creating databases Rendering HTML faster Q49. Which is the best default choice for variables in modern JavaScript? var let for everything const unless reassignment is needed global variables Q50. Which practice helps you write safer modern JavaScript? Use optional chaining and nullish coalescing intentionally Always use var in loops Avoid modules in production Never handle Promise errors Finish Test Your Result