Skip to content

(feat) Day 12 done #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ I am an independent educator and open-source enthusiast who creates meaningful p
- **`Day 08: Mastering JavaScript Execution Context Visually`** - [Watch Video](https://youtu.be/ylx5F7hbzVQ) || [Source Code](https://github.com/tapascript/40-days-of-javascript/blob/main/day-08/README.md)
- **`Day 09: Mastering Temporal Dead Zone and Hoisting`** - [Watch Video](https://youtu.be/OqMxh1QdYEg) || [Source Code](https://github.com/tapascript/40-days-of-javascript/blob/main/day-09/README.md)
- **`Day 10: Mastering Scope and Scope Chain`** - [Watch Video](https://youtu.be/14H2TsrjcLo) || [Source Code](https://github.com/tapascript/40-days-of-javascript/blob/main/day-10/README.md)
- **`Day 11: Learn Closures With Real-World Examples`** - [Watch Video](https://youtu.be/lA7CGz3iHyI) || [Source Code](https://github.com/tapascript/40-days-of-javascript/blob/main/day-11/README.md)
- **`Day 11: Learn Closures With Real-World Examples`** - [Watch Video](https://youtu.be/lA7CGz3iHyI) || [Source Code](https://github.com/tapascript/40-days-of-javascript/blob/main/day-11/README.md)
- **`Day 12: Mastering JavaScript Objects Real-World Examples`** - [Watch Video](https://youtu.be/c5vEfYj5yZM) || [Source Code](https://github.com/tapascript/40-days-of-javascript/blob/main/day-12/README.md)
4 changes: 3 additions & 1 deletion day-11/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- ✅ Closure & Event Handlers

## 🫶 Support

Your support means a lot.

- Please SUBSCRIBE to [tapaScript YouTube Channel](https://youtube.com/tapasadhikary) if not done already. A Big Thank You!
Expand All @@ -21,14 +22,15 @@ Your support means a lot.
> Many Thanks to all the `Stargazers` who have supported this project with stars(⭐)

### 🤝 Sponsor My Work

I am an independent educator and open-source enthusiast who creates meaningful projects to teach programming on my YouTube Channel. **You can support my work by [Sponsoring me on GitHub](https://github.com/sponsors/atapas) or [Buy Me a Cofee](https://buymeacoffee.com/tapasadhikary)**.

## Video

Here is the video for you to go through and learn:

[![day-11](./banner.png)](https://youtu.be/lA7CGz3iHyI "Video")


## **👩‍💻 🧑‍💻 Assignment Tasks**

Please find the task assignments in the [Task File](./task.md).
65 changes: 65 additions & 0 deletions day-12/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Day 12 - 40 Days of JavaScript

## **🎯 Goal of This Lesson**

- ✅ Welcome To Day 12
- ✅ What Will We Cover?
- ✅ JavaScript Objects
- ✅ Create Objects with Literal Syntax
- ✅ Accessing Object Properties
- ✅ Adding New Property to Object
- ✅ Keys With Special Characters
- ✅ Modifying Existing Property Value
- ✅ Deleting a Key From Object
- ✅ Accessing Dynamic Key Value
- ✅ Create Object With Dynamic Values
- ✅ Constructor Function To Create Objects
- ✅ Using Object Constructor
- ✅ Using Factory Function
- ✅ Object Shorthand
- ✅ Object Methods
- ✅ Nested Objects
- ✅ The “in” operator
- ✅ The for…in loop
- ✅ Object.keys() method
- ✅ Object References
- ✅ B.R.E.A.K
- ✅ Object.assign()
- ✅ Shallow Copy vs. Deep Copy
- ✅ Convert an Object to an Array
- ✅ Concert Map or Array to Object
- ✅ Immutability with freeze()
- ✅ Immutability with seal()
- ✅ The hasOwn() Method
- ✅ What is Object Destructuring?
- ✅ Create a New Variable
- ✅ Aliases
- ✅ Nested Object Destructuring
- ✅ Destructuring to Function Parameter
- ✅ Destructure a Function Return Value
- ✅ Destructuring in Loops
- ✅ Optional Chaining
- ✅ Are You Tired?

## 🫶 Support

Your support means a lot.

- Please SUBSCRIBE to [tapaScript YouTube Channel](https://youtube.com/tapasadhikary) if not done already. A Big Thank You!
- Liked my work? It takes months of hard work to create quality content and present it to you. You can show your support to me with a STAR(⭐) to this repository.

> Many Thanks to all the `Stargazers` who have supported this project with stars(⭐)

### 🤝 Sponsor My Work

I am an independent educator and open-source enthusiast who creates meaningful projects to teach programming on my YouTube Channel. **You can support my work by [Sponsoring me on GitHub](https://github.com/sponsors/atapas) or [Buy Me a Cofee](https://buymeacoffee.com/tapasadhikary)**.

## Video

Here is the video for you to go through and learn:

[![day-12](./banner.png)](https://youtu.be/c5vEfYj5yZM "Video")

## **👩‍💻 🧑‍💻 Assignment Tasks**

Please find the task assignments in the [Task File](./task.md).
Binary file added day-12/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
85 changes: 85 additions & 0 deletions day-12/destructuring.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
console.log("Learn Object Destructuring....")

const student = {
'name': 'John Williamson',
'age': 9,
'std': 3,
'subjects': ['Maths', 'English', 'EVS'],
'parents': {
'father': 'Brown Williamson',
'mother': 'Sophia',
'email': 'john-parents@abcde.com'
},
'address': {
'street': '65/2, brooklyn road',
'city': 'Carterton',
'country': 'New Zealand',
'zip': 5791
}
}

const {name, age, meal="bread"} = student;
console.log(name, age, meal);

const {subjects, numberOfSubjects = subjects.length} = student;
console.log(numberOfSubjects); // 3

const {std: standard} = student;
console.log(standard)

const {address: {zip}} = student;
console.log(zip);

function sendEmail({parents: {email}}) {
console.log(`Sent an email to ${email}`)
}

sendEmail(student);



const getStudent = () => {
return {
'name': 'John Williamson',
'age': 9,
'std': 3,
'subjects': ['Maths', 'English', 'EVS'],
'parents': {
'father': 'Brown Williamson',
'mother': 'Sophia',
'email': 'john-parents@abcde.com'
},
'address': {
'street': '65/2, brooklyn road',
'city': 'Carterton',
'country': 'New Zealand',
'zip': 5791
}
}
}

const {name: anotherName, subjects: anotherSubs} = getStudent();
console.log(anotherName, anotherSubs)


const students = [
{
'name': 'William',
'grade': 'A'
},
{
'name': 'Tom',
'grade': 'A+'
},
{
'name': 'Bob',
'grade': 'B'
}
];

for ( let {name, grade} of students) {
console.log(name, grade)
}



12 changes: 12 additions & 0 deletions day-12/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Objects</title>
<script defer src="./oc.js"></script>
</head>
<body>
<h1>Welcome to the <u>Day 12</u> of "40 Days of JavaScript!"</h1>
</body>
</html>
Loading