JavaScript Functions Guide
javascript
functions
closures
async
Function Types
Function Declaration
- Hoisted: Can be called before the declaration.
Function Expression
- Not hoisted: Cannot be used before the declaration.
Arrow Function
- Shorter syntax, no
this
context.
Advanced Concepts
Closures
- Functions that "remember" the variables in their scope.
Async Functions
- Return promises, allow
await
for asynchronous code.