Practice & Assessment
Test your understanding of ES6+ Modern JavaScript Features
Multiple Choice Questions
5What does the spread operator (...) do when used with an array?
How many default exports can a JavaScript module have?
What does the 'extends' keyword do in a JavaScript class?
Which of the following correctly uses object destructuring in a function parameter?
What is the difference between rest parameters and the spread operator?
Coding Challenges
1Build a Modular Utility Library
Create two JavaScript module files. In utils.js, export named functions: formatCurrency(amount), capitalise(str), and clamp(value, min, max). In app.js, import all three and demonstrate each with at least two test cases per function. Use destructuring, template literals, and default parameter values throughout.
Mini Project
Object-Oriented Task Manager with Classes
Build a Task Manager using ES6 classes. Create a Task class with properties: id, title, description, priority ('low', 'medium', 'high'), and completed (default false). Add methods: complete(), toString(). Create a TaskManager class that holds an array of tasks with methods: addTask(taskData), removeTask(id), filterByPriority(level), and getStats() (returns total, completed, pending counts). Build a simple HTML interface that uses these classes and displays tasks dynamically. Use destructuring, spread, and template literals throughout.
