Sintassi
🚀 ES6+ Features
Dichiarazioni di Variabili
// bad - var has function scope and hoisting issues
var user = 'John'
var users = []
// bad - no re-assignment but used let
let API_URL = 'https://api.example.com'
// bad - re-assigning const
const currentUser = null
currentUser = user // TypeError// good - use const by default
const API_URL = 'https://api.example.com'
const users = []
// good - use let only when reassignment is needed
let currentUser = null
let retryCount = 0
// good - const with objects/arrays (contents can change)
const user = {
name: 'John',
age: 30
}
user.age = 31 // OK - object contents can changeArrow Functions
Template Literals
Destructuring
Spread Operator
🔧 Control Flow
Conditional Statements
Loops and Iteration
🎯 Modern Syntax Features
Optional Chaining
Nullish Coalescing
Object Property Shorthand
🔄 Best Practices
Function Declarations
Return Statements
Last updated