From 4d9992e3565ff46d9c66d1c96c9b826af91924f6 Mon Sep 17 00:00:00 2001 From: lina mierkE Date: Thu, 8 Oct 2020 16:08:23 -0400 Subject: [PATCH 1/7] test 1 js --- fundamentals.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fundamentals.js b/fundamentals.js index 61adf3e..cc7c08d 100644 --- a/fundamentals.js +++ b/fundamentals.js @@ -2,7 +2,7 @@ // #1: Create an array of strings called `foods` that contains three foods. // Type your solution immediately below this line: - +var foods = ["strawberry", "banana","apple"] // #2: Access the last item in the array and assign to a variable called `last`. // Type your solution immediately below this line: From 5b9849b9757cadaf4248e9b90c32dfbcbd6bd5f9 Mon Sep 17 00:00:00 2001 From: lina mierkE Date: Thu, 8 Oct 2020 16:16:20 -0400 Subject: [PATCH 2/7] fail 2 --- fundamentals.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fundamentals.js b/fundamentals.js index cc7c08d..648684b 100644 --- a/fundamentals.js +++ b/fundamentals.js @@ -2,12 +2,12 @@ // #1: Create an array of strings called `foods` that contains three foods. // Type your solution immediately below this line: -var foods = ["strawberry", "banana","apple"] +var foods = ["strawberry", "banana","apple"]; // #2: Access the last item in the array and assign to a variable called `last`. // Type your solution immediately below this line: - - +var arr = []; +var last = arr.slice(-1)[0]; // #3: Create an empty array called `favoriteFoods`. // Type your solution immediately below this line: From ac32eba6640f84e59635b34c0d5cd3a198899f3b Mon Sep 17 00:00:00 2001 From: lina mierkE Date: Thu, 8 Oct 2020 16:17:23 -0400 Subject: [PATCH 3/7] 3 --- fundamentals.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fundamentals.js b/fundamentals.js index 648684b..612e50d 100644 --- a/fundamentals.js +++ b/fundamentals.js @@ -11,7 +11,7 @@ var last = arr.slice(-1)[0]; // #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`. From 403f8f955ccc55673f9209bf1f92272395b31a85 Mon Sep 17 00:00:00 2001 From: lina mierkE Date: Thu, 8 Oct 2020 16:20:43 -0400 Subject: [PATCH 4/7] 4 --- fundamentals.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fundamentals.js b/fundamentals.js index 612e50d..db9502b 100644 --- a/fundamentals.js +++ b/fundamentals.js @@ -16,7 +16,9 @@ var 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; i++){ + foods[i].join(favoriteFoods); +} // #5: Create an object literal called `instructor` that contains three key-value pairs. From 8e53c33740d22a8be7bc7d7598fbf279830fdca0 Mon Sep 17 00:00:00 2001 From: lina mierkE Date: Thu, 8 Oct 2020 16:23:05 -0400 Subject: [PATCH 5/7] 5 --- fundamentals.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fundamentals.js b/fundamentals.js index db9502b..ccd726a 100644 --- a/fundamentals.js +++ b/fundamentals.js @@ -23,7 +23,11 @@ for ( i=0; i <= foods.length; i++){ // #5: Create an object literal called `instructor` that contains three key-value pairs. // Type your solution immediately below this line: - +var instructor = { + firstName: "Bob", + lastName: "Smith", + age: 100 +}; // #6: Add a `has-office-hours` (spelled exactly) property to `instructor` by accessing From 307deebab732bad02c99d3322b2b67b26da2543d Mon Sep 17 00:00:00 2001 From: lina mierkE Date: Thu, 8 Oct 2020 16:29:24 -0400 Subject: [PATCH 6/7] idk 6 --- fundamentals.js | 1 + 1 file changed, 1 insertion(+) diff --git a/fundamentals.js b/fundamentals.js index ccd726a..424c4c5 100644 --- a/fundamentals.js +++ b/fundamentals.js @@ -34,3 +34,4 @@ var instructor = { // 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'; \ No newline at end of file From eb15e19fb8956cf46f6330ef0f2f7a787c51f9fd Mon Sep 17 00:00:00 2001 From: lina mierkE Date: Thu, 8 Oct 2020 16:51:54 -0400 Subject: [PATCH 7/7] donE --- oojs.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/oojs.js b/oojs.js index 4c836c7..54188cd 100644 --- a/oojs.js +++ b/oojs.js @@ -6,7 +6,14 @@ // - an `addSong` method that adds a song (string) to the `songs` array // Type your solution immediately below this line: - +class Playlist { + constructor(title){ + this.title= title + } +var songs= []; +function addSong(i) { + return songs.push(i); +} @@ -15,7 +22,7 @@ // Type your solution immediately below this line: - +myPlaylist= new Playlist (addSong("hello A")); // NOTE: THE CODE BELOW IS FOR TESTING PURPOSES. DO NOT REMOVE OR ALTER.