Skip to content

Commit a23ec14

Browse files
committed
Changed exercise 4-3 wording
1 parent 0c86052 commit a23ec14

File tree

8 files changed

+33
-1
lines changed
  • .learn/resets
  • exercises/04.3-Add_items_to_array

8 files changed

+33
-1
lines changed

.learn/resets/01-Hello_World/app.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// console log hello world here
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Declaring the array
2+
let myArray = ['sunday','monday','tuesday','wednesday','thursday','friday','saturday'];
3+
4+
// 1. print the 3rd item here
5+
6+
// 2. change the 'thursday' value to null here
7+
8+
// 3. print the position of step 2
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
let arr = [4,5,734,43,45,100,4,56,23,67,23,58,45,3,100,4,56,23];
2+
3+
// your code here
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
function generateRandomArray()
2+
{
3+
let auxArray = [];
4+
let randomLength = Math.floor(Math.random()*100);
5+
for(let i = 0; i < randomLength; i++) auxArray.push(Math.floor(Math.random()*100));
6+
return auxArray;
7+
}
8+
let myStupidArray = generateRandomArray();
9+
10+
// Your code here
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// Change the conditions of the for loop
2+
for(let number = 0; number < 10; number++) {
3+
// Print the number
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// Your code here
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
let arr = [4,5,734,43,45];
2+
3+
// Your code here, use the push() function and the 2 Math functions
4+
5+
console.log(arr);

exercises/04.3-Add_items_to_array/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ tutorial: https://www.youtube.com/watch?v=LMOIly1JTes
1010

1111
## 💡 Hints:
1212

13-
+ You can use the `Math.random()` and `Math.floor()` functions to get random numbers.
13+
+ You can use Math.random() to generate random numbers, and then use Math.floor() to round them down to the nearest integer.
1414

1515
+ You have to use the `.push()` function to add the new random numbers to the array.

0 commit comments

Comments
 (0)