function* generator() {
yield 1;
yield 2;
yield 3;
}
const gen = generator();
console.log(gen.next().value
); // Output: 1
console.log(gen.next().value); // Output: 2
console.log(gen.next().value); // Output: 3
ES6 introduced many powerful features that have revolutionized how we write JavaScript. From block-scoped variables with `let` and `const` to modern asynchronous handling with Promises and Async/Await, ES6 has made JavaScript more expressive, easier to use, and more efficient. By mastering these features, you can write cleaner, more maintainable code and take full advantage of the capabilities of modern JavaScript.