Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trouble shoot #55

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
9 changes: 7 additions & 2 deletions arrays/exercises/part-one-arrays.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
//Create an array called practiceFile with the following entry: 273.15

let practiceFile = [273.15]
//Use the bracket notation method to add "42" and "hello" to the array. Add these new items one at a time. Print the array after each step to confirm the changes.

practiceFile.push("42");
console.log(practiceFile)
practiceFile.push("hello");
console.log(practiceFile);
//Use a single .push() to add the following items: false, -4.6, and "87". Print the array to confirm the changes.
practiceFile.push(false,-4.6,"87");
console.log(practiceFile)
5 changes: 4 additions & 1 deletion arrays/exercises/part-three-arrays.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ let cargoHold = [1138, 'space suits', 'parrot', 'instruction manual', 'meal pack
//Use splice to make the following changes to the cargoHold array. Be sure to print the array after each step to confirm your updates.

//1) Insert the string 'keys' at index 3 without replacing any other entries.

cargoHold.splice(3,0,'keys');
console.log(cargoHold)
//2) Remove ‘instruction manual’ from the array. (Hint: indexOf is helpful to avoid manually counting an index).

//3) Replace the elements at indexes 2 - 4 with the items ‘cat’, ‘fob’, and ‘string cheese’.
cargoHold.splice(2,3,'cat','fob','string cheese');
console.log(cargoHold);
15 changes: 11 additions & 4 deletions arrays/exercises/part-two-arrays.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
let cargoHold = ['oxygen tanks', 'space suits', 'parrot', 'instruction manual', 'meal packs', 'slinky', 'security blanket'];

//1) Use bracket notation to replace ‘slinky’ with ‘space tether’. Print the array to confirm the change.

cargoHold[5] = 'space tether'
console.log(cargoHold)
//2) Remove the last item from the array with pop. Print the element removed and the updated array.

console.log(cargoHold.pop());
console.log(cargoHold);
//3) Remove the first item from the array with shift. Print the element removed and the updated array.

console.log(cargoHold.shift());
console.log(cargoHold);
//4) Unlike pop and shift, push and unshift require arguments inside the (). Add the items 1138 and ‘20 meters’ to the the array - the number at the start and the string at the end. Print the updated array to confirm the changes.

cargoHold.push('20 meters')
console.log(cargoHold);
cargoHold.unshift(1138)
con
//5) Use a template literal to print the final array and its length.
console.log(`The array ${cargoHold} has a length of ${cargoHold.length}.`);
13 changes: 5 additions & 8 deletions arrays/studio/array-string-conversion/array-testing.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,24 @@ strings = [protoArray1, protoArray2, protoArray3, protoArray4];
function reverseCommas() {
//TODO: 1. create and instantiate your variables.
let check;
let output;
let output = protoArray1.split(",").reverse().join(",");
//TODO: 2. write the code required for this step

//NOTE: For the code to run properly, you must return your output. this needs to be the final line of code within the function's { }.
return output;
}

//3)
function semiDash() {
let check;
let output;
let output = protoArray2.split(";").sort().join("-");
//TODO: write the code required for this step


return output;
}

//4)
function reverseSpaces() {
let check;
let output;
let output = protoArray3.split(" ").sort().reverse().join(" ");
//TODO: write the code required for this step

return output;
Expand All @@ -38,7 +35,7 @@ function reverseSpaces() {
//5)
function commaSpace() {
let check;
let output;
let output = protoArray4.split(", ").reverse().join(", ");
//TODO: write the code required for this step

return output;
Expand All @@ -51,4 +48,4 @@ module.exports = {
semiDash: semiDash,
reverseSpaces : reverseSpaces,
commaSpace : commaSpace
};
};

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Loading