3 ms·
I could be wrong, but don’t JavaScript’s closures rely on arrow syntax?
by AA-BA-94-2A-56 3y ago
I could be wrong, but don’t JavaScript’s closures rely on arrow syntax?
- takinola 3y agoI'm pretty sure closures are available to any function regardless of how they are defined. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Closures https://developer.mozilla.org/en-US/docs/Web/JavaScript/Clos...
- irrational 3y agoNo, anything you can do with arrow functions can be done without them. Arrow functions are just a simpler way of writing code. For example, you can control "this" in non-arrow functions using tools like call, apply, and bind. It is just more verbose.