Week 3 Day 2: JavaScript ES6 features
This commit is contained in:
26
Week-3/Day-2/Readme.md
Normal file
26
Week-3/Day-2/Readme.md
Normal file
@@ -0,0 +1,26 @@
|
||||
# Week 3 – Day 2
|
||||
## Advanced JavaScript – ES6 Features
|
||||
|
||||
### Date
|
||||
30 December 2025
|
||||
|
||||
### Objective
|
||||
To learn modern JavaScript (ES6) syntax for cleaner and efficient code.
|
||||
|
||||
### Topics Covered
|
||||
- let and const
|
||||
- Arrow functions
|
||||
- Template literals
|
||||
- Destructuring
|
||||
|
||||
### Activities Performed
|
||||
- Practiced ES6 syntax
|
||||
- Refactored existing code
|
||||
- Used modern JS features
|
||||
|
||||
### Learning Outcomes
|
||||
- Improved code readability
|
||||
- Learned modern JavaScript standards
|
||||
|
||||
### Status
|
||||
Completed
|
||||
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
|
||||
9
Week-3/Day-2/script.js
Normal file
9
Week-3/Day-2/script.js
Normal file
@@ -0,0 +1,9 @@
|
||||
const user = {
|
||||
name: "Harshit",
|
||||
role: "Intern"
|
||||
};
|
||||
|
||||
const greet = ({ name, role }) =>
|
||||
`Hello ${name}, Role: ${role}`;
|
||||
|
||||
console.log(greet(user));
|
||||
Reference in New Issue
Block a user