Hi all,
Just finished my random quote machine. It has a very simple design, nothing fancy. Will appreciate any feedback.
Hi all,
Just finished my random quote machine. It has a very simple design, nothing fancy. Will appreciate any feedback.
It seems to work well! I like the simple design too. Well done!
That looks great! You’ve got a clever way of selecting the quote and author, but there’s a small change we can make to the way you store quotes to improve the inner workings of the app. Instead of having two arrays, one with quotes and one with authors, you could have an array of objects. Each object would have both the quote and the author together.
var quotes = [{
text: "Life is the best",
author: "A happy person"
},
{
text: "Life is awful",
author: "A sad person"
}
];
Then you can get the random quote much like you’re doing, but you’ve got quote.text
and quote.author
. This is just a bit easier to read, debug, and make changes to in the future.
Simple and effective. I really like it. Nice work!
Thanks for your words of encouragement!