Skip to content

Merging Chnages with switch branch #12

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 22 commits into from
Jul 19, 2024
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
d0aaba5
Merge pull request #1 from yashksaini-coder/backup
yashksaini-coder Jul 17, 2024
c73014a
Merge pull request #2 from yashksaini-coder/backup
yashksaini-coder Jul 17, 2024
b72e8b8
Merge pull request #3 from yashksaini-coder/backup
yashksaini-coder Jul 17, 2024
80c12f9
Merge pull request #4 from yashksaini-coder/backup
yashksaini-coder Jul 17, 2024
8a49ea0
Merge pull request #5 from yashksaini-coder/backup
yashksaini-coder Jul 17, 2024
14b50b0
Activity 2 completed of Day-5
yashksaini-coder Jul 17, 2024
f845d76
Merge pull request #6 from yashksaini-coder/backup
yashksaini-coder Jul 17, 2024
815ec5f
Merge pull request #7 from yashksaini-coder/backup
yashksaini-coder Jul 17, 2024
b0468a1
Merge pull request #8 from yashksaini-coder/backup
yashksaini-coder Jul 17, 2024
17903e0
Merge pull request #9 from yashksaini-coder/backup
yashksaini-coder Jul 17, 2024
9d5b8c9
Merge pull request #10 from yashksaini-coder/backup
yashksaini-coder Jul 18, 2024
78bda1f
Update README.md
yashksaini-coder Jul 18, 2024
8befcc5
Merge pull request #11 from yashksaini-coder/backup
yashksaini-coder Jul 18, 2024
85d8039
Activity 1 completed for Day 6
yashksaini-coder Jul 18, 2024
4f2129e
Activity 2 completed for Day 6
yashksaini-coder Jul 18, 2024
7631706
Activity 3 completed for Day 6
yashksaini-coder Jul 18, 2024
6768818
All Activities completed for Day 6
yashksaini-coder Jul 18, 2024
bebf2e3
Update README
yashksaini-coder Jul 18, 2024
e2d499f
Adding the files now so i don't have to take time in the day
yashksaini-coder Jul 18, 2024
84f3de7
Added Empty list bcz tasks will be released tomorrow --> 7 AM
yashksaini-coder Jul 18, 2024
957ada3
Add Activities for Day 7
yashksaini-coder Jul 19, 2024
769468f
Activity-1 completed for Day 7
yashksaini-coder Jul 19, 2024
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
26 changes: 13 additions & 13 deletions Day6/Task.md
Original file line number Diff line number Diff line change
@@ -16,31 +16,31 @@ This workshop is divided into several activities:

### Activity 1: Array Creation and Access 🔍

- [ ] **Task 1:** Create an array of numbers from 1 to 5 and log the array to the console.
- [ ] **Task 2:** Access the first and last elements of the array and log them to the console.
- [X] **Task 1:** Create an array of numbers from 1 to 5 and log the array to the console.
- [X] **Task 2:** Access the first and last elements of the array and log them to the console.

### Activity 2: Array Methods (Basic) 💡

- [ ] **Task 3:** Use the `push` method to add a new number to the end of the array and log the updated array.
- [ ] **Task 4:** Use the `pop` method to remove the last element from the array and log the updated array.
- [ ] **Task 5:** Use the `shift` method to remove the first element from the array and log the updated array.
- [ ] **Task 6:** Use the `unshift` method to add a new number to the beginning of the array and log the updated array.
- [X] **Task 3:** Use the `push` method to add a new number to the end of the array and log the updated array.
- [X] **Task 4:** Use the `pop` method to remove the last element from the array and log the updated array.
- [X] **Task 5:** Use the `shift` method to remove the first element from the array and log the updated array.
- [X] **Task 6:** Use the `unshift` method to add a new number to the beginning of the array and log the updated array.

### Activity 3: Array Methods (Intermediate) 🚀

- [ ] **Task 7:** Use the `map` method to create a new array where each number is doubled and log the new array.
- [ ] **Task 8:** Use the `filter` method to create a new array with only even numbers and log the new array.
- [ ] **Task 9:** Use the `reduce` method to calculate the sum of all numbers in the array and log the result.
- [X] **Task 7:** Use the `map` method to create a new array where each number is doubled and log the new array.
- [X] **Task 8:** Use the `filter` method to create a new array with only even numbers and log the new array.
- [X] **Task 9:** Use the `reduce` method to calculate the sum of all numbers in the array and log the result.

### Activity 4: Array Iteration 🎯

- [ ] **Task 10:** Use a `for` loop to iterate over the array and log each element to the console.
- [ ] **Task 11:** Use the `forEach` method to iterate over the array and log each element to the console.
- [X] **Task 10:** Use a `for` loop to iterate over the array and log each element to the console.
- [X] **Task 11:** Use the `forEach` method to iterate over the array and log each element to the console.

### Activity 5: Multi-dimensional Arrays 🛠️

- [ ] **Task 12:** Create a two-dimensional array (matrix) and log the entire array to the console.
- [ ] **Task 13:** Access and log a specific element from the two-dimensional array.
- [X] **Task 12:** Create a two-dimensional array (matrix) and log the entire array to the console.
- [X] **Task 13:** Access and log a specific element from the two-dimensional array.

## Feature Requests (Optional) 🎨

80 changes: 80 additions & 0 deletions Day6/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
console.log("-------------------------------------------------");
console.log("Activity 1: ");

// Task 1: Create an array of numbers from 1 to 5 and log the array to the console.
let arr = [1,2,3,4,5];
console.log("The Array is:- "+arr);

// Task 2:- Access the first and last elements of the array and log them to the console.
console.log("The first element of the array is:- "+arr[0]);
console.log("The last element of the array is:- "+arr[arr.length-1]);


console.log("-------------------------------------------------");
console.log("Activity 2: ");

// Task 3: Use the `push` method to add a new number to the end of the array and log the updated array.
arr[5] = arr.push(6);
console.log("The Array is:- "+arr);

// Task 4: Use the `pop` method to remove the last element from the array and log the updated array.
arr.pop();
console.log("The Array is:- "+arr);

// Task 5: Use the `shift` method to remove the first element from the array and log the updated array.
arr.shift();
console.log("The Array is:- "+arr);

// Task 6: Use the `unshift` method to add a new number to the beginning of the array and log the updated array.
arr.unshift(1);
console.log("The Array is:- "+arr);


console.log("-------------------------------------------------");
console.log("Activity 3: ");

// Task 7: Use the `map` method to create a new array where each number is doubled and log the new array.

let mapArr = arr.map((num) => num*2);
console.log("The new mapped Array is:- "+mapArr);

// Task 8: Use the `filter` method to create a new array with only even numbers and log the new array.

let filterarr = arr.filter((num) => num%2 == 0);
console.log("The new filtered Array is:- "+filterarr);

// Task 9: Use the `reduce` method to calculate the sum of all numbers in the array and log the result.

let reducearr = arr.reduce((acc, num) => acc+num, 0);
console.log("The sum of all the numbers in the array is:- "+reducearr);


console.log("-------------------------------------------------");
console.log("Activity 4: ");

// Task 10: Use a `for` loop to iterate over the array and log each element to the console.
console.log("Using for loop:- ");
for(let i=0; i<arr.length; i++){
console.log("Element at index "+i+" is:- "+arr[i]);
}

// Task 11: Use the `forEach` method to iterate over the array and log each element to the console.
console.log("Using forEach method:- ");
arr.forEach((num, index) => {
console.log("Element at index "+index+" is:- "+num);
});

console.log("-------------------------------------------------");
console.log("Activity 5: ");

// Task 12: Create a two-dimensional array (matrix) and log the entire array to the console.
let matrix = [[1,2,3],
[4,5,6],
[7,8,9]];
console.log("The Matrix is:- "+matrix);

// Task 13: Access and log a specific element from the two-dimensional array.
console.log("The element at 2nd row and 3rd column is:- "+matrix[1][2]);
console.log("The element at 3rd row and 2nd column is:- "+matrix[2][1]);

console.log("-------------------------------------------------");
47 changes: 47 additions & 0 deletions Day7/Task.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Day 7: Objects

Welcome to Day 7 of our JavaScript workshop! Today, we will explore objects, a core component of JavaScript programming. 📚

## Learning Objectives 📚

By the end of these activities, you will:
- Create and manipulate objects with properties and methods.
- Understand and use the `this` keyword in object methods.
- Work with nested objects and arrays of objects.
- Iterate over an object's properties using loops and built-in methods.

## Activities 🛠️

This workshop is divided into several activities:

### Activity 1: Object Creation and Access 🔍

- [ ] **Task 1:** Create an object representing a book with properties like `title`, `author`, and `year`, and log the object to the console.
- [ ] **Task 2:** Access and log the `title` and `author` properties of the book object.

### Activity 2: Object Methods 💡

- [ ] **Task 3:** Add a method to the book object that returns a string with the book's title and author, and log the result of calling this method.
- [ ] **Task 4:** Add a method to the book object that takes a parameter (year) and updates the book's year property, then log the updated object.

### Activity 3: Nested Objects 🚀

- [ ] **Task 5:** Create a nested object representing a library with properties like `name` and `books` (an array of book objects), and log the library object to the console.
- [ ] **Task 6:** Access and log the name of the library and the titles of all the books in the library.

### Activity 4: The `this` Keyword 🎯

- [ ] **Task 7:** Add a method to the book object that uses the `this` keyword to return a string with the book's title and year, and log the result of calling this method.

### Activity 5: Object Iteration 🛠️

- [ ] **Task 8:** Use a `for...in` loop to iterate over the properties of the book object and log each property and its value.
- [ ] **Task 9:** Use `Object.keys` and `Object.values` methods to log all the keys and values of the book object.

## Feature Requests (Optional) 🎨

1. **Book Object Script:** Write a script that creates a book object, adds methods to it, and logs its properties and method results.
2. **Library Object Script:** Create a script that defines a library object containing an array of book objects and logs the library's details.
3. **Object Iteration Script:** Write a script that demonstrates iterating over an object's properties using `for...in` loop and `Object.keys`/`Object.values`.

Happy coding! 💻✨
16 changes: 16 additions & 0 deletions Day7/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
console.log("-------------------------------------------------");
console.log("Activity 1: ");

// Task 1: Create an object representing a book with properties like `title`, `author`, and `year`, and log the object to the console.

const book = {
title: "Rich Dad Poor Dad",
author: "Robert T Kiyosaki",
year: "2020"
};
console.log(book);

// Task 2: Access and log the `title` and `author` properties of the book object.

console.log("The title of the Book is:- " + book.title);
console.log("The author of the book is:- " + book.author);
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ To use the projects in this repository, follow these steps:

1. Clone the repository to your local machine.
2. Navigate to the project folder you want to use.
3. Follow the instructions provided in the project's README file.
3. Follow the instructions provided in each Day Task README file.

## Author