Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random Quote Generator using JS #1189

Closed
Yashpreeth opened this issue May 10, 2024 · 2 comments
Closed

Random Quote Generator using JS #1189

Yashpreeth opened this issue May 10, 2024 · 2 comments

Comments

@Yashpreeth
Copy link

`// Array of quotes
const quotes = [
"The only way to do great work is to love what you do. Steve Jobs",
"Innovation distinguishes between a leader and a follower. Steve Jobs",
"Stay hungry; stay foolish. Steve Jobs",
"Life is what happens when you're busy making other plans. John Lennon",
"You miss 100% of the shots you don't take. Wayne Gretzky",
"The only limit to our realization of tomorrow will be our doubts of today. Franklin D. Roosevelt"
];

function to generate random quote
function generateRandomQuote() {
const randomIndex = Math.floor(Math.random() * quotes.length);
return quotes[randomIndex];
}

Example usage
console.log(generateRandomQuote());
`

Copy link

Thank you for opening your first issue in our repository! One of our maintainers will get in touch with you soon.

@swapnilsparsh
Copy link
Owner

Thank you for providing your insight but it is not required as of now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants