From 030256cc4502f3ef1ad2f0dd04a1c7ee27ff04be Mon Sep 17 00:00:00 2001 From: Rebecca Pellegran Date: Thu, 8 Oct 2020 16:41:50 -0400 Subject: [PATCH 1/3] . --- fundamentals.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fundamentals.js b/fundamentals.js index 61adf3e..2cadef9 100644 --- a/fundamentals.js +++ b/fundamentals.js @@ -2,21 +2,25 @@ // #1: Create an array of strings called `foods` that contains three foods. // Type your solution immediately below this line: +var foods = ["mashed potatoes", "tacos", "pierogis"] // #2: Access the last item in the array and assign to a variable called `last`. // Type your solution immediately below this line: - +foods[2] = "last"; // #3: Create an empty array called `favoriteFoods`. // Type your solution immediately below this line: - +var favoriteFoods =[] // #4: Create a `for` loop that adds each string in `foods` to `favoriteFoods`. // Type your solution immediately below this line: +var foods = ["mashed potatoes", "tacos", "pierogis"] +var favoriteFoods = [] +var theFoods = foods.concat(favoriteFoods); // #5: Create an object literal called `instructor` that contains three key-value pairs. From e3e39947308f17f19dd247b590353d07f25dcd24 Mon Sep 17 00:00:00 2001 From: Rebecca Pellegran Date: Thu, 8 Oct 2020 16:56:43 -0400 Subject: [PATCH 2/3] completed fundamentals --- fundamentals.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/fundamentals.js b/fundamentals.js index 2cadef9..e1c83e1 100644 --- a/fundamentals.js +++ b/fundamentals.js @@ -18,17 +18,27 @@ var favoriteFoods =[] // #4: Create a `for` loop that adds each string in `foods` to `favoriteFoods`. // Type your solution immediately below this line: -var foods = ["mashed potatoes", "tacos", "pierogis"] -var favoriteFoods = [] +var foods = ["mashed potatoes", "tacos", "pierogis"]; +var favoriteFoods = []; var theFoods = foods.concat(favoriteFoods); // #5: Create an object literal called `instructor` that contains three key-value pairs. // Type your solution immediately below this line: - +var instructor = { + name: "Noah", + year: 2020, + famous: true, +} // #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: +var instructor = { + name: "Noah", + year: 2020, + famous: true, + "has-office-hours": true, +} From 0548c5a3e5a2e87170817d9f6e38c8e8db88345d Mon Sep 17 00:00:00 2001 From: Rebecca Pellegran Date: Thu, 8 Oct 2020 17:02:50 -0400 Subject: [PATCH 3/3] c --- oojs.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/oojs.js b/oojs.js index 4c836c7..71f7835 100644 --- a/oojs.js +++ b/oojs.js @@ -6,7 +6,13 @@ // - an `addSong` method that adds a song (string) to the `songs` array // Type your solution immediately below this line: +class Playlist + constructor (title,songs,addSong){ + this.title= title; + this.addSong= songs + let songs = []; + }