Which of the following is a **reserved keyword** in JavaScript?
A
class B
item C
value D
number
Analysis & Theory
`class` is a reserved keyword in JavaScript and is used to define classes.
Which keyword is used to declare a block-scoped variable?
A
define B
var C
let D
const
Analysis & Theory
`let` is used to declare block-scoped variables. It's a reserved keyword.
Which of these is **NOT** a reserved word in JavaScript?
A
await B
finally C
throw D
print
Analysis & Theory
`print` is not a reserved keyword in JavaScript and can be used as a variable name.
Which of the following keywords is used to handle exceptions?
A
throw B
break C
switch D
goto
Analysis & Theory
`throw` is used to manually throw exceptions in JavaScript.
What is the purpose of the `return` keyword?
A
To exit a loop B
To end the script C
To exit a function and return a value D
To break a switch statement
Analysis & Theory
`return` exits a function and optionally returns a value.
Which keyword is used to define a function?
A
procedure B
func C
function D
define
Analysis & Theory
`function` is the reserved keyword used to define a function in JavaScript.
Which keyword is used to define a constant?
A
final B
const C
static D
fixed
Analysis & Theory
`const` is used to declare a constant value in JavaScript.
Which of these is a JavaScript **control flow** keyword?
A
continue B
execute C
respond D
run
Analysis & Theory
`continue` is used to skip the current iteration in a loop and proceed to the next one.
Which keyword starts a conditional block?
A
case B
when C
if D
try
Analysis & Theory
`if` is the reserved keyword used for conditional logic.
Which of these **cannot** be used as a variable name in JavaScript?
A
data B
result C
var D
score
Analysis & Theory
`var` is a reserved keyword and cannot be used as a variable name.