WorksheetsJavaScript Basics MCQ Worksheet
Total questions: 20
Worksheet time: 10mins
JavaScript is mainly used for
Styling web pages
Structuring web pages
Making web pages interactive
Creating databases
Which tag is used to write JavaScript in HTML?
<js>
<javascript>
<script>
<code>
Which file extension is used for external JavaScript?
.html
.css
.java
.js
JavaScript is a ______ language.
Case-insensitive
Case-sensitive
Both
None
Which symbol is used for single-line comments in JavaScript?
#
<!-- -->
//
/* */
Which method shows output in a popup box?
console.log()
document.write()
alert()
prompt()
Which keyword is used to declare a constant variable?
var
let
static
const
Which data type stores true or false values?
Number
String
Boolean
Undefined
What is the output of typeof 25?
string
number
boolean
object
Which one is a non-primitive data type?
Number
String
Boolean
Array
Which operator is used to compare both value and data type?
==
=
===
!=
Which loop executes at least once?
for
while
do...while
for...in
Which statement is used to check multiple conditions?
if
if...else
else if
switch
Which keyword stops the loop completely?
stop
exit
break
continue
Which loop is used to iterate an array?
for...in
for...of
while
do...while
Which loop is used to iterate object properties?
for
for...of
for...in
while
Which operator is used for logical AND?
&
||
!
&&
Which statement skips the current loop iteration?
break
continue
return
stop
JavaScript works together with
HTML only
CSS only
HTML and CSS
Java only
In below which represents the OR?
&&
| |
!
&
