5 Differences Between Arrow and Regular Functions
dmitripavlutin.com · 1,631 words · saved by 1 readers
The 5 must-know differences between arrow and regular functions in JavaScript.
5 Differences Between Arrow and Regular Functions Updated March 21, 2023 javascript function arrow function -- Comments You can define JavaScript functions in many ways . The first, usual way, is by using the function keyword: // Function declaration function greet(who) { return `Hello, ${who}!`; } // Function expression const greet = function(who) { return `Hello, ${who}`; } The function declaration and function expression I'm going to reference as regular function . The second way, available starting ES2015, is the arrow function syntax: const greet = (who) => { return `Hello, ${who}!`; } Wh
related reading
- GitHub - Experience-Monks/math-as-code: a cheat-sheet for mathematical notation in code formgithub.com
- Functions — reusable blocks of code - Learn web development | MDNdeveloper.mozilla.org
- Functions · Crafting Interpreterscraftinginterpreters.com
- JS cheat sheetprogramming-idioms.org
- Language Reference | Arduino Documentationdocs.arduino.cc
- Arity - Wikipediaen.wikipedia.org
- TypeScript: Documentation - More on Functionstypescriptlang.org
- Reading 13: Map, Filter, Reduceweb.mit.edu
- do’s and don’ts – Digital Digressions by Stuart Sierrastuartsierra.com
- Reading 12: Regular Expressions & Grammarsweb.mit.edu
- Classes - JavaScript | MDNdeveloper.mozilla.org
- Intrinsic Values Test | Discover What Your Most Important Values Are | ClearerThinking.orgprograms.clearerthinking.org