From 853119144b6ce03cda9180d081667e109fd1bd52 Mon Sep 17 00:00:00 2001 From: MattCarolus10 Date: Thu, 5 Nov 2026 23:12:38 +0000 Subject: [PATCH 01/11] object prep --- Sprint-2/prep/ordered-data.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Sprint-2/prep/ordered-data.js diff --git a/Sprint-2/prep/ordered-data.js b/Sprint-2/prep/ordered-data.js new file mode 100644 index 0000000000..016c7f9b25 --- /dev/null +++ b/Sprint-2/prep/ordered-data.js @@ -0,0 +1,18 @@ +// const profileData = { +// firstName: "Franceso", +// lastName: "Leoni", +// age: 33, +// } + +// // console.log(profileData.cityOfResidence); +// profileData.cityOfResidence = "Manchester" +// console.log(profileData.cityOfResidence); + +const object1 = { + firstName: "Franceso", + lastName: "Leoni", +} + +const object2 = {}; +object2.firstName = "Franceso"; +object2.lastName = "Leoni"; \ No newline at end of file From e06f169911e207c4adb1cef2c18578423f9f6cf4 Mon Sep 17 00:00:00 2001 From: MattCarolus10 Date: Thu, 12 Nov 2026 19:55:33 +0000 Subject: [PATCH 02/11] Add console log to test pickFromArray with quotes array --- Sprint-3/quote-generator/quotes.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Sprint-3/quote-generator/quotes.js b/Sprint-3/quote-generator/quotes.js index 4a4d04b722..e233639747 100644 --- a/Sprint-3/quote-generator/quotes.js +++ b/Sprint-3/quote-generator/quotes.js @@ -490,4 +490,6 @@ const quotes = [ }, ]; +console.log(pickFromArray(quotes)); + // call pickFromArray with the quotes array to check you get a random quote From 7d614be6de3e82b0e0b946b75cfa6f23044f73f3 Mon Sep 17 00:00:00 2001 From: MattCarolus10 Date: Thu, 12 Nov 2026 19:55:43 +0000 Subject: [PATCH 03/11] Fix HTML doctype and update title for quote generator app --- Sprint-3/quote-generator/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sprint-3/quote-generator/index.html b/Sprint-3/quote-generator/index.html index 30b434bcfb..befe8788e2 100644 --- a/Sprint-3/quote-generator/index.html +++ b/Sprint-3/quote-generator/index.html @@ -1,9 +1,9 @@ - + - Title here + Quote generator app From aab75597174697d5588801138ef6a3bd3339cfbe Mon Sep 17 00:00:00 2001 From: MattCarolus10 Date: Thu, 12 Nov 2026 20:04:29 +0000 Subject: [PATCH 04/11] Display a random quote in the quote generator app --- Sprint-3/quote-generator/quotes.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Sprint-3/quote-generator/quotes.js b/Sprint-3/quote-generator/quotes.js index e233639747..a2293fd798 100644 --- a/Sprint-3/quote-generator/quotes.js +++ b/Sprint-3/quote-generator/quotes.js @@ -490,6 +490,7 @@ const quotes = [ }, ]; -console.log(pickFromArray(quotes)); +const selectedQuote = pickFromArray(quotes); +document.getElementById("quote").textContent = selectedQuote.quote; // call pickFromArray with the quotes array to check you get a random quote From faa4b4732133103a37c6c1879037471c5422c609 Mon Sep 17 00:00:00 2001 From: MattCarolus10 Date: Thu, 12 Nov 2026 20:07:25 +0000 Subject: [PATCH 05/11] Display author name alongside the selected quote in the quote generator app --- Sprint-3/quote-generator/quotes.js | 1 + 1 file changed, 1 insertion(+) diff --git a/Sprint-3/quote-generator/quotes.js b/Sprint-3/quote-generator/quotes.js index a2293fd798..924ebe9352 100644 --- a/Sprint-3/quote-generator/quotes.js +++ b/Sprint-3/quote-generator/quotes.js @@ -492,5 +492,6 @@ const quotes = [ const selectedQuote = pickFromArray(quotes); document.getElementById("quote").textContent = selectedQuote.quote; +document.getElementById("author").textContent = selectedQuote.author; // call pickFromArray with the quotes array to check you get a random quote From fd0e8598a8c5a1fe759afb1ac38ded4897c55a49 Mon Sep 17 00:00:00 2001 From: MattCarolus10 Date: Thu, 12 Nov 2026 20:13:25 +0000 Subject: [PATCH 06/11] Refactor quote display logic into showQuote function --- Sprint-3/quote-generator/quotes.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Sprint-3/quote-generator/quotes.js b/Sprint-3/quote-generator/quotes.js index 924ebe9352..914e24bb65 100644 --- a/Sprint-3/quote-generator/quotes.js +++ b/Sprint-3/quote-generator/quotes.js @@ -16,6 +16,7 @@ // pickFromArray(['a','b','c','d']) // maybe returns 'c' // You don't need to change this function + function pickFromArray(choices) { return choices[Math.floor(Math.random() * choices.length)]; } @@ -490,8 +491,11 @@ const quotes = [ }, ]; -const selectedQuote = pickFromArray(quotes); -document.getElementById("quote").textContent = selectedQuote.quote; -document.getElementById("author").textContent = selectedQuote.author; +function showQuote() { + const selectedQuote = pickFromArray(quotes); + document.getElementById("quote").textContent = selectedQuote.quote; + document.getElementById("author").textContent = selectedQuote.author; +} + // call pickFromArray with the quotes array to check you get a random quote From 9edde22639e9fcefba7f7b77ed4da6f5bd378dde Mon Sep 17 00:00:00 2001 From: MattCarolus10 Date: Thu, 12 Nov 2026 20:13:53 +0000 Subject: [PATCH 07/11] Call showQuote function to display a random quote and author --- Sprint-3/quote-generator/quotes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sprint-3/quote-generator/quotes.js b/Sprint-3/quote-generator/quotes.js index 914e24bb65..4a16ccc2f2 100644 --- a/Sprint-3/quote-generator/quotes.js +++ b/Sprint-3/quote-generator/quotes.js @@ -496,6 +496,6 @@ function showQuote() { document.getElementById("quote").textContent = selectedQuote.quote; document.getElementById("author").textContent = selectedQuote.author; } - +showQuote(); // call pickFromArray with the quotes array to check you get a random quote From 263334843cc584dfa9b700dd78e4d43e4ba13048 Mon Sep 17 00:00:00 2001 From: MattCarolus10 Date: Thu, 12 Nov 2026 20:20:01 +0000 Subject: [PATCH 08/11] Add event listener to generate a new quote on button click --- Sprint-3/quote-generator/quotes.js | 1 + 1 file changed, 1 insertion(+) diff --git a/Sprint-3/quote-generator/quotes.js b/Sprint-3/quote-generator/quotes.js index 4a16ccc2f2..b6beb5e589 100644 --- a/Sprint-3/quote-generator/quotes.js +++ b/Sprint-3/quote-generator/quotes.js @@ -498,4 +498,5 @@ function showQuote() { } showQuote(); +document.getElementById("new-quote").addEventListener("click", showQuote); // call pickFromArray with the quotes array to check you get a random quote From fee3a396436c55aac99e4c4311f1c3aab5fe1bcd Mon Sep 17 00:00:00 2001 From: MattCarolus10 Date: Thu, 12 Nov 2026 20:20:54 +0000 Subject: [PATCH 09/11] Add comment to verify random quote selection using pickFromArray --- Sprint-3/quote-generator/quotes.js | 1 + 1 file changed, 1 insertion(+) diff --git a/Sprint-3/quote-generator/quotes.js b/Sprint-3/quote-generator/quotes.js index b6beb5e589..54dc18c141 100644 --- a/Sprint-3/quote-generator/quotes.js +++ b/Sprint-3/quote-generator/quotes.js @@ -499,4 +499,5 @@ function showQuote() { showQuote(); document.getElementById("new-quote").addEventListener("click", showQuote); + // call pickFromArray with the quotes array to check you get a random quote From 0cd676c6de6d2c747dd64bb18bbfbcae9b0bab32 Mon Sep 17 00:00:00 2001 From: MattCarolus10 Date: Thu, 12 Nov 2026 20:24:53 +0000 Subject: [PATCH 10/11] Add interval to automatically display a new quote every 5 seconds --- Sprint-3/quote-generator/quotes.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Sprint-3/quote-generator/quotes.js b/Sprint-3/quote-generator/quotes.js index 54dc18c141..c9c90896f1 100644 --- a/Sprint-3/quote-generator/quotes.js +++ b/Sprint-3/quote-generator/quotes.js @@ -499,5 +499,7 @@ function showQuote() { showQuote(); document.getElementById("new-quote").addEventListener("click", showQuote); +setInterval(showQuote, 5000); + // call pickFromArray with the quotes array to check you get a random quote From a7959495ffff160b20c991b0c99629de3bd49e40 Mon Sep 17 00:00:00 2001 From: MattCarolus10 Date: Thu, 12 Nov 2026 21:36:41 +0000 Subject: [PATCH 11/11] Remove prep from quote generator branch --- Sprint-2/prep/ordered-data.js | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 Sprint-2/prep/ordered-data.js diff --git a/Sprint-2/prep/ordered-data.js b/Sprint-2/prep/ordered-data.js deleted file mode 100644 index 016c7f9b25..0000000000 --- a/Sprint-2/prep/ordered-data.js +++ /dev/null @@ -1,18 +0,0 @@ -// const profileData = { -// firstName: "Franceso", -// lastName: "Leoni", -// age: 33, -// } - -// // console.log(profileData.cityOfResidence); -// profileData.cityOfResidence = "Manchester" -// console.log(profileData.cityOfResidence); - -const object1 = { - firstName: "Franceso", - lastName: "Leoni", -} - -const object2 = {}; -object2.firstName = "Franceso"; -object2.lastName = "Leoni"; \ No newline at end of file