Week 3 Day 2: JavaScript ES6 features

This commit is contained in:
2026-01-09 15:50:45 +05:30
parent 6d6a8fd0ea
commit 865fcf0db7
3 changed files with 54 additions and 0 deletions

26
Week-3/Day-2/Readme.md Normal file
View 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

View 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
View File

@@ -0,0 +1,9 @@
const user = {
name: "Harshit",
role: "Intern"
};
const greet = ({ name, role }) =>
`Hello ${name}, Role: ${role}`;
console.log(greet(user));