We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6e2c774 commit 144ba1dCopy full SHA for 144ba1d
Sprint-3/quote-generator/quotes.js
@@ -1,3 +1,15 @@
1
+function getRandomQuote() {
2
+ const randomQuote = Math.floor(Math.random() * quotes.length);
3
+ return quotes[randomQuote];
4
+}
5
+function showQuote() {
6
+ const quote = pickFromArray(quotes);
7
+ document.getElementById("quote").innerText = `"${quote.quote}"`;
8
+ document.getElementById("author").innerText = `- ${quote.author}`;
9
10
+window.onload = showQuote;
11
+document.getElementById("new-quote").addEventListener("click", showQuote);
12
+
13
// DO NOT EDIT BELOW HERE
14
15
// pickFromArray is a function which will return one item, at
0 commit comments