NEW
Font size
WorksheetsG9-4.1JavaScript Basics Quiz
Total questions: 14
Worksheet time: 7mins
What is the primary purpose of JavaScript in web development?
To create interactive content
To structure web pages
To style web pages
To manage databases
Which operator is used for addition in JavaScript?
+
/
*
-
What is the correct way to declare a variable in JavaScript?
let a = 10;
int a = 10;
declare a = 10;
let a : 10;
Which of the following is a primitive data type in JavaScript?
Function
String
Object
Array
What does the console.log() function do?
Shows output in a popup
Displays output in an alert box
Prints output to the console
Writes output to a file
What is the result of 2 ** 3 in JavaScript?
9
4
8
6
Which operator is used to compare two values for equality in JavaScript?
!=
==
===
=
What will be the output of the expression 5 == '5'?
undefined
NaN
false
true
What is the purpose of the increment operator (++) in JavaScript?
To assign a value
To multiply a value by 2
To increase a value by 1
To decrease a value by 1
Which of the following is NOT a comparison operator in JavaScript?
==
===
++
!==
What will the expression 10 % 3 return?
3
1
10
0
What is the output of console.log(typeof 'Hello')?
object
number
undefined
string
Which of the following is a non-primitive data type in JavaScript?
Boolean
Array
String
Number
What is the result of the expression (5 + 3) * 2?
8
16
10
12
