Skip to content

Commit

Permalink
Changed exercise 4-3 wording
Browse files Browse the repository at this point in the history
  • Loading branch information
ericmc27 committed Sep 21, 2024
1 parent 0c86052 commit a23ec14
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 1 deletion.
1 change: 1 addition & 0 deletions .learn/resets/01-Hello_World/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// console log hello world here
8 changes: 8 additions & 0 deletions .learn/resets/02.1-Access_and_retrieve/app.js
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions .learn/resets/02.2-Retrieve_Items/app.js
Original file line number Diff line number Diff line change
@@ -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
10 changes: 10 additions & 0 deletions .learn/resets/03-Print_the_last_one/app.js
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions .learn/resets/04.1-Loop_from_one_to_seventeen/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Change the conditions of the for loop
for(let number = 0; number < 10; number++) {
// Print the number
}
1 change: 1 addition & 0 deletions .learn/resets/04.2-Loop_from_seven_to_twelve/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// Your code here
5 changes: 5 additions & 0 deletions .learn/resets/04.3-Add_items_to_array/app.js
Original file line number Diff line number Diff line change
@@ -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);
2 changes: 1 addition & 1 deletion exercises/04.3-Add_items_to_array/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

0 comments on commit a23ec14

Please sign in to comment.