What is the purpose of the 'do-while' loop in JavaScript?
To execute a block of code at least once, and then repeatedly as long as a condition is true.
To declare a function.
To skip the current iteration of a loop.
To execute a block of code only if a condition is true.
Is it possible to have multiple 'catch' blocks associated with a single 'try' block?
Yes, to handle different error types specifically
Only if you re-throw the error inside the first 'catch'
Only if the 'try' block is nested inside another 'try'
No, you can only have one 'catch' per 'try'
Which operator is used to check for strict equality (value and type) in JavaScript?
=
==
===
!=
Which keyword is used to define an arrow function in JavaScript?
arrow
=>
function
new
What is the result of the expression: 10 % 3?
10 % 3
3
0
1
10
Which data type represents a sequence of characters in JavaScript?
number
string
object
boolean
How can you access the error message from a caught error?
error.text
error.message
error.getMessage()
error.toString()
Which keyword is used to declare a variable in JavaScript with block-level scope?
let
const
var
block
Which of these is NOT a valid way to create a custom error in JavaScript?
throw new CustomError('This is a custom error')
throw new Error('This is a custom error')
throw { message: 'This is a custom error' }
throw 'This is a custom error'
What is the primary role of the browser's JavaScript engine?
Defining the structure of a web page
Fetching data from a server
Styling web page elements
Interpreting and executing JavaScript code