-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
58 lines (54 loc) · 2.96 KB
/
index.html
File metadata and controls
58 lines (54 loc) · 2.96 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
58
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>JavaScript Quiz</title>
<link rel="stylesheet" href="css/style.css">
<script src="js/script.js"></script>
</head>
<body>
<div id="container">
<header>
<h1>Simple JavaScript Quiz</h1>
<p>Test your knowledge in <strong>JavaScript Fundamentals</strong></p>
</header>
<section>
<div id="results"></div>
<form name="quizForm" onsubmit="return submitAns()">
<h3>1. Which is not a primitive data type in JavaScript?</h3>
<input type="radio" name="q1" value="a" id="q1a">a. boolean<br>
<input type="radio" name="q1" value="b" id="q1b">b. number<br>
<input type="radio" name="q1" value="c" id="q1c">c. string<br>
<input type="radio" name="q1" value="d" id="q1d">d. character<br>
<h3>2. Which of these will throw a SyntaxError?</h3>
<input type="radio" name="q2" value="a" id="q2a">a. if (x == 1) { }<br>
<input type="radio" name="q2" value="b" id="q2b">b. if (x = 1) { }<br>
<input type="radio" name="q2" value="c" id="q2c">c. if (x ==== 1) { }<br>
<input type="radio" name="q2" value="d" id="q2d">d. if (x === 1) { }<br>
<h3>3. The var statement is used to:</h3>
<input type="radio" name="q3" value="a" id="q3a">a. Create a new local variable<br>
<input type="radio" name="q3" value="b" id="q3b">b. Retrieve a variable descriptor<br>
<input type="radio" name="q3" value="c" id="q3c">c. Declare a member of a class<br>
<input type="radio" name="q3" value="d" id="q3d">d. Change a constant<br>
<h3>4. What is the difference between == and === ?</h3>
<input type="radio" name="q4" value="a" id="q4a">a. The == is used in comparison, and === is used in value assignment.<br>
<input type="radio" name="q4" value="b" id="q4b">b. The == operator converts both operands to the same type, whereas === returns false for different types.
<br>
<h3>5. Which of the following operators can assign a value to a variable?</h3>
<input type="radio" name="q5" value="a" id="q5a">a. =<br>
<input type="radio" name="q5" value="b" id="q5b">b. +=<br>
<input type="radio" name="q5" value="c" id="q5c">c. %=<br>
<input type="radio" name="q5" value="d" id="q5d">d. All of these<br>
<br>
<br>
<input type="submit" value="Submit Answers">
</form>
</section>
<footer>
<p>Copyright © 2020, All righrs reserved</p>
</footer>
</div>
</body>
</html>