Arrow Functions
What happens if you try to use 'yield' within an arrow function?
If you try to use the 'yield' keyword within an arrow function, it will throw a SyntaxError. Arrow functions cannot be generator functions. The 'yield' keyword can only be used within generator functions, which are defined using the function* syntax (e.g., `function* myGenerator() { yield 1; }`). This is one of several features that arrow functions intentionally do not support. Arrow functions are designed to be lightweight and specifically suited for non-method functions, especially those that don't need their own `this`, `arguments`, `super`, or `new.target` bindings. If you need to create a generator, you must use a regular function declaration or expression with the generator syntax. This limitation is consistent with the focused design of arrow functions, which prioritizes conciseness and lexical binding for common function use cases over supporting all possible function features. Other features arrow functions don't support include being constructors, having their own `this` binding, and accessing `arguments`.