-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathjavascript-challenge.html
43 lines (34 loc) · 1.09 KB
/
javascript-challenge.html
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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Javascript Challenge!</title>
<meta name="description" content="This page contains the essentials for a modern HTML5 web page">
<meta name="author" content="kaizen-soze">
</head>
<body>
<h1>Javascript Challenge</h1>
<p>Using javascript, output the times tables from 0 - 100 for a specified number to the javascript console.</p>
<p>The bulk of your logic should live inside a method that takes the number you
want to see the times table for.</p>
<p>
Requirements:
<ol>
<li>Use at least one function that accepts a number.</li>
<li>Use at least one loop</li>
<li>Output results to the console.</li>
<li>Use the format: 5 * 0 = 0 for your output</li>
</ol>
</p>
<p>If you get stuck, please reach out to Ben for hints and help!</p>
<script>
function timesTables(x) {
for (i = 0; i <= 100; i++) {
const total = x * i
console.log(`${x} * ${i} = ${total}`)
}
}
timesTables(5)
</script>
</body>
</html>