-
Notifications
You must be signed in to change notification settings - Fork 374
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pending changes exported from your codespace
- Loading branch information
Showing
47 changed files
with
265 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
// console log hello world here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
//you code here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
//***************** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]); | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.