12 lines
368 B
JavaScript
12 lines
368 B
JavaScript
|
|
const quotesForPage = {
|
|
getQuoteData: async function() {
|
|
return (await axios.get('/static/json/quotes.json')).data;
|
|
},
|
|
|
|
getRandomQuoteAsync: async function() {
|
|
let quotes = (await quotesForPage.getQuoteData()).christmasQuotes;
|
|
let indexChoice = Math.floor(Math.random() * quotes.length);
|
|
return quotes[indexChoice];
|
|
}
|
|
} |