Skip to content

Commit da857e3

Browse files
Fix formatting and improve readability in chooseQuote function
1 parent f41fe77 commit da857e3

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

Sprint-3/quote-generator/quotes.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -493,15 +493,15 @@ const quotes = [
493493
// call pickFromArray with the quotes array to check you get a random quote
494494

495495
function chooseQuote() {
496-
const randomQuote = pickFromArray(quotes)
496+
const randomQuote = pickFromArray(quotes);
497497

498498
const quote = document.getElementById("quote");
499-
if(quote!==null){
500-
quote.textContent = randomQuote.quote;
499+
if (quote !== null) {
500+
quote.textContent = randomQuote.quote;
501501
}
502502
const author = document.getElementById("author");
503-
if(author!==null){
504-
author.textContent = randomQuote.author;
503+
if (author !== null) {
504+
author.textContent = randomQuote.author;
505505
}
506506
}
507507

@@ -513,7 +513,7 @@ button.addEventListener("click", chooseQuote);
513513
const autoGenerate = document.getElementById("auto-play-toggle");
514514
let interval = null;
515515
autoGenerate.addEventListener("change", () => {
516-
let changeQuoteInterval=2000
516+
let changeQuoteInterval = 2000;
517517
if (autoGenerate.checked) {
518518
interval = setInterval(chooseQuote, changeQuoteInterval);
519519
} else {

0 commit comments

Comments
 (0)