Skip to content

Commit 62a2e4a

Browse files
author
Arthur
committed
destructuring
1 parent 7d4e22a commit 62a2e4a

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎Sprint-3/quote-generator/quotes.js‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@ function updateWebpageWithQuote() {
2929
const authorDisplay = document.querySelector("#author");
3030

3131
// store into the variable
32-
const randomPick = pickFromArray(quotes);
33-
quoteDisplay.innerText = randomPick.quote;
34-
authorDisplay.innerText = randomPick.author;
32+
33+
const { quote, author } = pickFromArray(quotes);
34+
quoteDisplay.innerText = quote;
35+
authorDisplay.innerText = author;
3536
}
3637

3738
// Second condition: when a person enter the website, it should have a quote appear;

0 commit comments

Comments
 (0)