Skip to content
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions checkpoint-javascript-seir
Submodule checkpoint-javascript-seir added at e1b1be
17 changes: 13 additions & 4 deletions fundamentals.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,38 @@
// #1: Create an array of strings called `foods` that contains three foods.
// Type your solution immediately below this line:


foods = [ham, cheese, fish];

// #2: Access the last item in the array and assign to a variable called `last`.
// Type your solution immediately below this line:


last = fish.slice(-1)[0]

// #3: Create an empty array called `favoriteFoods`.
// Type your solution immediately below this line:


favoriteFoods = []

// #4: Create a `for` loop that adds each string in `foods` to `favoriteFoods`.
// Type your solution immediately below this line:

for(i =0,i < foods.length - 1, i++) {
favoriteFoods = foods(i)
}


// #5: Create an object literal called `instructor` that contains three key-value pairs.
// Type your solution immediately below this line:
instructor = {
name:"bob",
city:"new york",
age: 30


}


// #6: Add a `has-office-hours` (spelled exactly) property to `instructor` by accessing
// it (do not change the original object you typed above) and assigning it
// a boolean value.
// Type your solution immediately below this line:
instructor.has-office-hours =true;
6 changes: 5 additions & 1 deletion hof.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ var people = [
// person in the `people` array. Assign the returned array to a variable
// called `peopleNames`.
// Type your solution immediately below this line:

var peopleNames = []
var peopleNames = people.map() {

return peopleNames
});


// #2: Use the `filter` array method to create a new, filtered array containing only
Expand Down
20 changes: 19 additions & 1 deletion oojs.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,25 @@
// - a `songs` property that is an empty array not determined by input (not passed into the constructor)
// - an `addSong` method that adds a song (string) to the `songs` array
// Type your solution immediately below this line:
class myPlaylist {

constructor(title) {
this.title = title;
}

constructor(song)
this.song = []

addSong(sng) {
song.push(sng);
return this.song
}

}

// Usage:
let user = new User("John");
user.sayHi();



Expand All @@ -14,7 +32,7 @@
// Call the instance's `addSong` method to add a song to the instance's `songs` array
// Type your solution immediately below this line:


var myPlaylist = new MyPlaylist.addSong



Expand Down