MCPcopy
hub / github.com/zachgoll/fullstack-roadmap-series / showQuote

Function showQuote

code-challenges/lesson-7/solution/script.js:41–56  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

39}
40
41function showQuote() {
42 // Value should be in format: { quote: '', author: '' }
43 const randomQuote = getRandomData("quotes");
44
45 const quoteContainer = document.querySelector(".quote-content");
46
47 const newQuoteText = document.createElement("p");
48 const newQuoteAuthor = document.createElement("p");
49 newQuoteText.textContent = randomQuote.quote;
50 newQuoteAuthor.textContent = "- " + randomQuote.author;
51
52 clearAll();
53
54 quoteContainer.appendChild(newQuoteText);
55 quoteContainer.appendChild(newQuoteAuthor);
56}
57
58function showRiddle() {
59 // Value should be in format: { question: '', answer: '' }

Callers

nothing calls this directly

Calls 2

getRandomDataFunction · 0.70
clearAllFunction · 0.70

Tested by

no test coverage detected