vrd-random-quote
Version:
A simple package to return a random motivational quote
20 lines (17 loc) • 685 B
JavaScript
const quotes = [
"The only way to do great work is to love what you do. - Steve Jobs",
"Be yourself; everyone else is already taken. - Oscar Wilde",
"In three words I can sum up everything I've learned about life: it goes on. - Robert Frost",
"Life is what happens when you're busy making other plans. - John Lennon",
"The purpose of our lives is to be happy. - Dalai Lama"
];
/**
* Returns a random quote from the predefined list.
*
* @returns {string} A random quote.
*/
function getRandomQuote() {
const randomIndex = Math.floor(Math.random() * quotes.length);
return quotes[randomIndex];
}
module.exports = getRandomQuote;