From a23ec14728e1395bf17178989079e923eaae515a Mon Sep 17 00:00:00 2001 From: ericmc27 Date: Sat, 21 Sep 2024 00:39:17 +0000 Subject: [PATCH] Changed exercise 4-3 wording --- .learn/resets/01-Hello_World/app.js | 1 + .learn/resets/02.1-Access_and_retrieve/app.js | 8 ++++++++ .learn/resets/02.2-Retrieve_Items/app.js | 3 +++ .learn/resets/03-Print_the_last_one/app.js | 10 ++++++++++ .learn/resets/04.1-Loop_from_one_to_seventeen/app.js | 4 ++++ .learn/resets/04.2-Loop_from_seven_to_twelve/app.js | 1 + .learn/resets/04.3-Add_items_to_array/app.js | 5 +++++ exercises/04.3-Add_items_to_array/README.md | 2 +- 8 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 .learn/resets/01-Hello_World/app.js create mode 100644 .learn/resets/02.1-Access_and_retrieve/app.js create mode 100644 .learn/resets/02.2-Retrieve_Items/app.js create mode 100644 .learn/resets/03-Print_the_last_one/app.js create mode 100644 .learn/resets/04.1-Loop_from_one_to_seventeen/app.js create mode 100644 .learn/resets/04.2-Loop_from_seven_to_twelve/app.js create mode 100644 .learn/resets/04.3-Add_items_to_array/app.js diff --git a/.learn/resets/01-Hello_World/app.js b/.learn/resets/01-Hello_World/app.js new file mode 100644 index 00000000..d455757d --- /dev/null +++ b/.learn/resets/01-Hello_World/app.js @@ -0,0 +1 @@ +// console log hello world here \ No newline at end of file diff --git a/.learn/resets/02.1-Access_and_retrieve/app.js b/.learn/resets/02.1-Access_and_retrieve/app.js new file mode 100644 index 00000000..70c752f1 --- /dev/null +++ b/.learn/resets/02.1-Access_and_retrieve/app.js @@ -0,0 +1,8 @@ +// Declaring the array +let myArray = ['sunday','monday','tuesday','wednesday','thursday','friday','saturday']; + +// 1. print the 3rd item here + +// 2. change the 'thursday' value to null here + +// 3. print the position of step 2 diff --git a/.learn/resets/02.2-Retrieve_Items/app.js b/.learn/resets/02.2-Retrieve_Items/app.js new file mode 100644 index 00000000..00055b71 --- /dev/null +++ b/.learn/resets/02.2-Retrieve_Items/app.js @@ -0,0 +1,3 @@ +let arr = [4,5,734,43,45,100,4,56,23,67,23,58,45,3,100,4,56,23]; + +// your code here diff --git a/.learn/resets/03-Print_the_last_one/app.js b/.learn/resets/03-Print_the_last_one/app.js new file mode 100644 index 00000000..e4dc515a --- /dev/null +++ b/.learn/resets/03-Print_the_last_one/app.js @@ -0,0 +1,10 @@ +function generateRandomArray() +{ + let auxArray = []; + let randomLength = Math.floor(Math.random()*100); + for(let i = 0; i < randomLength; i++) auxArray.push(Math.floor(Math.random()*100)); + return auxArray; +} +let myStupidArray = generateRandomArray(); + +// Your code here diff --git a/.learn/resets/04.1-Loop_from_one_to_seventeen/app.js b/.learn/resets/04.1-Loop_from_one_to_seventeen/app.js new file mode 100644 index 00000000..11c47dca --- /dev/null +++ b/.learn/resets/04.1-Loop_from_one_to_seventeen/app.js @@ -0,0 +1,4 @@ +// Change the conditions of the for loop +for(let number = 0; number < 10; number++) { + // Print the number +} diff --git a/.learn/resets/04.2-Loop_from_seven_to_twelve/app.js b/.learn/resets/04.2-Loop_from_seven_to_twelve/app.js new file mode 100644 index 00000000..877a3aa0 --- /dev/null +++ b/.learn/resets/04.2-Loop_from_seven_to_twelve/app.js @@ -0,0 +1 @@ +// Your code here diff --git a/.learn/resets/04.3-Add_items_to_array/app.js b/.learn/resets/04.3-Add_items_to_array/app.js new file mode 100644 index 00000000..5e894127 --- /dev/null +++ b/.learn/resets/04.3-Add_items_to_array/app.js @@ -0,0 +1,5 @@ +let arr = [4,5,734,43,45]; + +// Your code here, use the push() function and the 2 Math functions + +console.log(arr); diff --git a/exercises/04.3-Add_items_to_array/README.md b/exercises/04.3-Add_items_to_array/README.md index e5faad91..bda2cdc8 100644 --- a/exercises/04.3-Add_items_to_array/README.md +++ b/exercises/04.3-Add_items_to_array/README.md @@ -10,6 +10,6 @@ tutorial: https://www.youtube.com/watch?v=LMOIly1JTes ## 💡 Hints: -+ You can use the `Math.random()` and `Math.floor()` functions to get random numbers. ++ You can use Math.random() to generate random numbers, and then use Math.floor() to round them down to the nearest integer. + You have to use the `.push()` function to add the new random numbers to the array.