Skip to content

Commit b669414

Browse files
committed
solutions up to 0.72
1 parent 5c8f7b7 commit b669414

File tree

24 files changed

+87
-93
lines changed

24 files changed

+87
-93
lines changed
-30.1 KB
Loading

bc.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
{
22
"language": "node",
3-
"repository": "https://github.com/4GeeksAcademy/javascript-arrays-exercises-tutorial"
3+
"title": "Learn Javascript Arrays and Loops Interactive",
4+
"repository": "https://github.com/4GeeksAcademy/javascript-arrays-exercises-tutorial",
5+
"preview": "https://github.com/4GeeksAcademy/javascript-arrays-exercises-tutorial/blob/master/preview.png?raw=true",
6+
"description": "Learn and javascript arrays and loops, interactive tutorial with dozens of react exercises, get instant feedback with automatic grading and watch video solutions afterwards.",
7+
"duration": 12,
8+
"difficulty": "easy",
9+
"video-solutions": true,
10+
"graded": true
411
}

exercises/02-Hello-World/app.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
// console log hello world here
2-
3-
console.log("Hello World");
1+
// console log hello world here
Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
11
//declaring the array
2-
3-
//. 0. 1. 2. 3. 4. 5. 6
42
var myArray = ['sunday','monday','tuesday','wednesday','thursday','friday','saturday'];
53

6-
74
//1. print the item here
8-
let dayOfWeek = myArray[2];
9-
console.log(dayOfWeek)
105

116
//2. change 'thursday'a value here to null
12-
myArray[4] = null;
137

14-
//3. print the position of step 2
15-
console.log(myArray[4])
8+
//3. print the position of step 2
Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
2-
// 0.1. 2. 3. 4. 5. 6.7. 8. 9. 10.....
31
var arr = [4,5,734,43,45,100,4,56,23,67,23,58,45,3,100,4,56,23];
42

5-
//your code here
6-
7-
let aux = arr[0];
8-
console.log(aux);
9-
10-
11-
console.log(arr[3]);
3+
//your code here

exercises/04.1-Print-the-last-one/app.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,4 @@ function generateRandomArray()
77
}
88
var myStupidArray = generateRandomArray();
99

10-
// 0. 1. 2
11-
let theLastOne = myStupidArray[myStupidArray.length - 1];
12-
console.log(theLastOne)
13-
10+
//Your code here
Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1 @@
1-
//you code here
2-
for(let i = 1; i <= 17; i = i + 1){
3-
console.log(i)
4-
}
5-
6-
let listOfHellos = new Array(17).fill("hello");
7-
for(let pos in listOfHellos){
8-
console.log(parseInt(pos)+1)
9-
}
10-
console.log("Third approach")
11-
listOfHellos.forEach((item, index) => {
12-
console.log(parseInt(index)+1)
13-
})
1+
//you code here
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
//you code here
2-
for(let position = 7; position <= 12; position = position + 1){
3-
console.log(position)
4-
}
1+
//you code here
Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
var arr = [4,5,734,43,45];
22

3-
//*****************
4-
// Your code here
5-
// you need to loop 10 times, for example, using a for loop
6-
// for(let i = 0; i<10;i++){
7-
// your loop content here
8-
// }
9-
//*****************
3+
// Your code here, use the push function and the random function.
104

11-
for(let i = 0; i<10; i++){
12-
arr.push(Math.floor(Math.random() * 100));
13-
}
14-
console.log(arr);
5+
console.log(arr);
Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
var arr = [4,5,734,43,45];
22

3-
//*****************
4-
// Your code here
5-
// you need to loop 10 times, for example, using a for loop
6-
// for(let i = 0; i<10;i++){
7-
// your loop content here
8-
// }
9-
//*****************
3+
arr.push(Math.floor(Math.random() * 100));
4+
arr.push(Math.floor(Math.random() * 100));
105

11-
for(let i = 0; i<10; i++){
12-
arr.push(Math.floor(Math.random() * 100));
13-
}
146
console.log(arr);

0 commit comments

Comments
 (0)