Week 3 Day 2: JavaScript ES6 features
This commit is contained in:
19
Week-3/Day-2/advanced-javascript.md
Normal file
19
Week-3/Day-2/advanced-javascript.md
Normal file
@@ -0,0 +1,19 @@
|
||||
## ES6 Features
|
||||
|
||||
### let & const
|
||||
let → block scoped
|
||||
const → cannot be reassigned
|
||||
|
||||
### Arrow Functions
|
||||
const add = (a, b) => a + b;
|
||||
|
||||
### Template Literals
|
||||
`Hello ${name}`
|
||||
|
||||
### Destructuring
|
||||
const { name, role } = user;
|
||||
|
||||
### Practical Learning
|
||||
Converted functions to arrow functions
|
||||
Used template strings
|
||||
Applied destructuring for cleaner code
|
||||
Reference in New Issue
Block a user