forked from HackYourFuture/JavaScript2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
30 lines (26 loc) · 911 Bytes
/
index.js
File metadata and controls
30 lines (26 loc) · 911 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// your code goes in here
const quotes = [
{
quote :`Life is like riding a bicycle, to keep your balance, you must keep moving.`,
author : '- Albert Einstein'
},{
quote:`Love the life you live. Live the life you love.`,
author: '- Bob Marley'
},{
quote:`Our greatest glory is not in never falling, but in rising every time we fall.`,
author: '- Confucius'
},{
quote:`First, solve the problem. Then, write the code`,
author: '– John Johnson'
},{
quote:`Experience is the name everyone gives to their mistakes.`,
author: '– Oscar Wilde'
},{
quote:`Code is like humor. When you have to explain it, it’s bad.`,
author: '– Cory House'
}];
function newQuote(){
let x = Math.floor(Math.random() * quotes.length);
document.getElementById('quote').innerText = quotes[x].quote;
document.getElementById('author').innerText = quotes[x].author;
};