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
57 lines (56 loc) · 1.68 KB
/
index.js
File metadata and controls
57 lines (56 loc) · 1.68 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// your code goes in here
'use strict';
// Collection Of Quote
const quotes = [
{
quote: `I'm not a great programmer; I'm just a good programmer with great habits.`,
author: `- Kent Beck`,
},
{
quote: `Talk is cheap. Show me the code.`,
author: `- Linus Torvalds`,
},
{
quote: `Programs must be written for people to read, and only incidentally for machines to execute.`,
author: `- Harold Abelson`,
},
{
quote: `Truth can only be found in one place: the code.`,
author: `- Robert C`,
},
{
quote: `Give a man a program, frustrate him for a day. Teach a man to program, frustrate him for a lifetime.`,
author: `- Muhammad Waseem`,
},
{
quote: `How you look at it is pretty much how you'll see it`,
author: `- Steve Jobs`,
},
{
quote: `The most disastrous thing that you can ever learn is your first programming language.`,
author: `- Alan Kay`,
},
{
quote: `The most important property of a program is whether it accomplishes the intention of its user.`,
author: `- C.A.R. Hoare`,
},
{
quote: `i am committed to push my branch to the master.`,
author: `- Halgurd Hussein`,
},
{
quote: `Coding is not just code, that is a live thing to serve everyone!`,
author: `- Ming Song`,
},
];
// New Quote Button
const quoteBtn = document.getElementById('quote-btn');
// Get Quote and author Section
const quote = document.getElementById('output');
const author = document.getElementById('author');
// Event Handler
quoteBtn.addEventListener('click', () => {
let random = Math.floor(Math.random() * quotes.length);
quote.innerHTML = quotes[random].quote;
author.innerHTML = quotes[random].author;
});