Skip to content

Commit

Permalink
Pending changes exported from your codespace
Browse files Browse the repository at this point in the history
  • Loading branch information
labs404 committed Jul 27, 2023
1 parent e6f308e commit 4350848
Show file tree
Hide file tree
Showing 47 changed files with 265 additions and 21 deletions.
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 item here

//2. change 'thursday'a value here to null

//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 @@
//you 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 random function.

console.log(arr);
6 changes: 6 additions & 0 deletions .learn/resets/04.4-Add_items_to_array_looping/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
let arr = [4,5,734,43,45];

//*****************
// Your code here
// you need to loop 10 times, for example, using a for loop
//*****************
4 changes: 4 additions & 0 deletions .learn/resets/05.1-Loop_Array/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
let myArray = [232,32,1,4,55,4,3,32,3,24,5,5,5,34,2,3,5,5365743,52,34,3,55,33,435,4,6,54,63,45,4,67,56,47,1,34,54,32,54,1,78,98,0,9,8,98,76,7,54,2,3,42,456,4,3321,5];

// wrap this console.log withing a loop and replace 0 with i
console.log(myArray[0]);
7 changes: 7 additions & 0 deletions .learn/resets/06.2-Loop-from-the-top/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
let mySampleArray = [3423,5,4,47889,654,8,867543,23,48,56432,55,23,25,12];


for(let i = 0; i<mySampleArray.length; i = i + 1)
{
console.log(mySampleArray[i]);
}
7 changes: 7 additions & 0 deletions .learn/resets/06.3-Loop-adding-two/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
let mySampleArray = [3423,5,4,47889,654,8,867543,23,48,56432,55,23,25,12];


for(let i = 0; i<mySampleArray.length; i = i + 1)
{
console.log(mySampleArray[i]);
}
10 changes: 10 additions & 0 deletions .learn/resets/06.4-Loop-from-the-half-to-the-end/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
let mySampleArray = [3423,5,4,47889,654,8,867543,23,48,56432,55,23,25,12];

let initialValue = 0;
let stopValue = 0;
let increasingValue = 1;

for(let i = initialValue; i<stopValue; i = i + increasingValue)
{
console.log(mySampleArray[i]);
}
3 changes: 3 additions & 0 deletions .learn/resets/06.5-One-last-looping/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
let mySampleArray = ['Esmeralda', 'Kiko', 'Ruth', 'Lebron', 'Pedro', 'Maria', 'Lou', 'Fernando', 'Cesco', 'Bart', 'Annie'];

//your code here
3 changes: 3 additions & 0 deletions .learn/resets/07.1-Finding-Waldo/app.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .learn/resets/07.2-Letter-Counter/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
let par = "Lorem ipsum dolor sit amet consectetur adipiscing elit Curabitur eget bibendum turpis Curabitur scelerisque eros ultricies venenatis mi at tempor nisl Integer tincidunt accumsan cursus"
let counts = {};

// your code here

console.log(counts);
3 changes: 3 additions & 0 deletions .learn/resets/07.3-Flip-Array/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
let arr = [45,67,87,23,5,32,60];

//Your code here.
3 changes: 3 additions & 0 deletions .learn/resets/08.1-Mixed-array/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
let mix = [42, true, "towel", [2,1], 'hello', 34.4, {"name": "juan"}];

//your code here
9 changes: 9 additions & 0 deletions .learn/resets/08.2-Count-On/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
let myArray = [42, true, "towel", [2,1], 'hello', 34.4, {"name": "juan"}];

let hello = [];
for(let index = 0; index < myArray.length; index++){
let element = myArray[index];
// MAGIC HAPPENS HERE
}

console.log(hello)
6 changes: 6 additions & 0 deletions .learn/resets/08.3-Sum-all-items/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
function sumTheElements(theArray){
let total = 0;
//your code here

return total;
}
6 changes: 6 additions & 0 deletions .learn/resets/09-forEach-loop/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
let myArray = [3344,34334,454543,342534,4563456,3445,23455,234,262,2335,43323,4356,345,4545,452,345,434,36,345,4334,5454,345,4352,23,365,345,47,63,425,6578759,768,834,754,35,32,445,453456,56,7536867,3884526,4234,35353245,53244523,566785,7547,743,4324,523472634,26665,63432,54645,32,453625,7568,5669576,754,64356,542644,35,243,371,3251,351223,13231243,734,856,56,53,234342,56,545343];

myArray.forEach(function(item, index, arr){
// The value of the item is
console.log(item);
});
11 changes: 11 additions & 0 deletions .learn/resets/10-Everything-is-awesome/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
let myArray = [ 1, 0, 0, 0, 1, 0, 0, 0, 1, 1 ];

const ZerosToYahoos = (arr) => {
let return_array = [];
arr.forEach((item,index) => {
// magic goes inside these brackets
});
return return_array;
};

console.log(ZerosToYahoos(myArray));
7 changes: 7 additions & 0 deletions .learn/resets/11-Do-while/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
let i = 20;

do {
// Magic goes here;

i--;
} while (i > 0);
7 changes: 7 additions & 0 deletions .learn/resets/12-Delete-element/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
let people = ['juan','ana','michelle','daniella','stefany','lucy','barak', 'emilio'];

//your code below

console.log(deletePerson('daniella'));
console.log(deletePerson('juan'));
console.log(deletePerson('emilio'));
10 changes: 10 additions & 0 deletions .learn/resets/13-Merge-arrays/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
let chunk_one = [ 'Lebron', 'Aaliyah', 'Diamond', 'Dominique', 'Aliyah', 'Jazmin', 'Darnell' ];
let chunk_two = [ 'Lucas' , 'Jake','Scott','Amy', 'Molly','Hannah','Lucas'];

const mergeArrays = (firstArray, secondArray) => {
let newArray = []
//your code here
return newArray
}

console.log(mergeArrays(chunk_one, chunk_two));
3 changes: 2 additions & 1 deletion exercises/01-Hello_World/app.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
// console log hello world here
// console log hello world here
console.log("Hello World")
5 changes: 4 additions & 1 deletion exercises/02.1-Access_and_retrieve/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
let myArray = ['sunday','monday','tuesday','wednesday','thursday','friday','saturday'];

//1. print the item here
console.log(myArray[2])

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

//3. print the position of step 2
//3. print the position of step 2
console.log(myArray[4]);
4 changes: 3 additions & 1 deletion exercises/02.2-Retrieve_Items/app.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
let arr = [4,5,734,43,45,100,4,56,23,67,23,58,45,3,100,4,56,23];

//your code here
//your code here
console.log(arr[0]);
console.log(arr[3]);
2 changes: 2 additions & 0 deletions exercises/03-Print_the_last_one/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ function generateRandomArray()
let myStupidArray = generateRandomArray();

//Your code here
let theLastOne = myStupidArray[myStupidArray.length-1]
console.log(myStupidArray[myStupidArray.length]);
3 changes: 2 additions & 1 deletion exercises/04.1-Loop_from_one_to_seventeen/app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//change the conditions of the for loop
for(let number = 0; number < 10; number++){
for(let number = 1; number < 18; number++){
//print the number
console.log(number);
}
6 changes: 5 additions & 1 deletion exercises/04.2-Loop_from_seven_to_twelve/app.js
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
//you code here
//you code here

for (let i = 7; i < 13; i++) {
console.log(i);
}
3 changes: 3 additions & 0 deletions exercises/04.3-Add_items_to_array/app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
let arr = [4,5,734,43,45];

// Your code here, use the push function and the random function.
arr.push(Math.floor(Math.random()*100));
arr.push(Math.floor(Math.random()*100));


console.log(arr);
5 changes: 5 additions & 0 deletions exercises/04.4-Add_items_to_array_looping/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@ let arr = [4,5,734,43,45];
// Your code here
// you need to loop 10 times, for example, using a for loop
//*****************
for (let i = 0; i < 10; i++ ) {
arr.push(Math.floor(Math.random()*100));
};

console.log(arr);
5 changes: 4 additions & 1 deletion exercises/05.1-Loop_Array/app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
let myArray = [232,32,1,4,55,4,3,32,3,24,5,5,5,34,2,3,5,5365743,52,34,3,55,33,435,4,6,54,63,45,4,67,56,47,1,34,54,32,54,1,78,98,0,9,8,98,76,7,54,2,3,42,456,4,3321,5];

// wrap this console.log withing a loop and replace 0 with i
console.log(myArray[0]);

for ( let i = 0; i < myArray.length; i++ ) {
console.log(myArray[i]);
}
3 changes: 1 addition & 2 deletions exercises/06.2-Loop-from-the-top/app.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
let mySampleArray = [3423,5,4,47889,654,8,867543,23,48,56432,55,23,25,12];


for(let i = 0; i<mySampleArray.length; i = i + 1)
{
for(let i = mySampleArray.length-1; i>-1; i--) {
console.log(mySampleArray[i]);
}
2 changes: 1 addition & 1 deletion exercises/06.3-Loop-adding-two/app.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
let mySampleArray = [3423,5,4,47889,654,8,867543,23,48,56432,55,23,25,12];


for(let i = 0; i<mySampleArray.length; i = i + 1)
for(let i = 0; i<mySampleArray.length; i = i + 2)
{
console.log(mySampleArray[i]);
}
6 changes: 3 additions & 3 deletions exercises/06.4-Loop-from-the-half-to-the-end/app.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
let mySampleArray = [3423,5,4,47889,654,8,867543,23,48,56432,55,23,25,12];

let initialValue = 0;
let stopValue = 0;
let initialValue = 7;
let stopValue = 14;
let increasingValue = 1;

for(let i = initialValue; i<stopValue; i = i + increasingValue)
{
console.log(mySampleArray[i]);
}
}
6 changes: 5 additions & 1 deletion exercises/06.5-One-last-looping/app.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
let mySampleArray = ['Esmeralda', 'Kiko', 'Ruth', 'Lebron', 'Pedro', 'Maria', 'Lou', 'Fernando', 'Cesco', 'Bart', 'Annie'];

//your code here
//your code here

for (let i = mySampleArray.length-1; i > -1; i--) {
console.log(mySampleArray[i]);
}
7 changes: 6 additions & 1 deletion exercises/07.1-Finding-Waldo/app.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions exercises/07.2-Letter-Counter/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,17 @@ let par = "Lorem ipsum dolor sit amet consectetur adipiscing elit Curabitur eget
let counts = {};

// your code here
for (let i in par) {
let letter = par[i].toLowerCase();
if (letter == " ") {
continue;
}
else if (counts[letter] == undefined) {
counts[letter] = 1;
}
else {
counts[letter] += 1;
}
}

console.log(counts);
21 changes: 21 additions & 0 deletions exercises/07.3-Flip-Array/app.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
let arr = [45,67,87,23,5,32,60];

//Your code here.
// newArr = [];
// for (let i in arr) {
// newArr.unshift(arr[i]);
// }


// newArr = [];
// for (let i = arr.length-1; i >- 1; i--) {
// newArr.push(arr[i]);
// // console.log(arr[i]);
// }

// console.log(newArr);


let flippedArray = []
for(let i = arr.length - 1; i>= 0;i--){
let item = arr[i];
flippedArray.push(item);
}
console.log(flippedArray)
9 changes: 8 additions & 1 deletion exercises/08.1-Mixed-array/app.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
let mix = [42, true, "towel", [2,1], 'hello', 34.4, {"name": "juan"}];

//your code here
//your code here
let arrayOfTypes = [];
for (let i in mix) {
// console.log(typeof(mix[i]));
arrayOfTypes.push(typeof(mix[i]));
}

console.log(arrayOfTypes);
10 changes: 9 additions & 1 deletion exercises/08.2-Count-On/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ let hello = [];
for(let index = 0; index < myArray.length; index++){
let element = myArray[index];
// MAGIC HAPPENS HERE
if (typeof(element) != 'object') {
continue;
}
else {
hello.push(element);
}


}

console.log(hello)
console.log(hello)
Loading

0 comments on commit 4350848

Please sign in to comment.