Which event is commonly used for handling form submissions?
'input'
'change'
'submit'
'click'
What will the browser display after running this JavaScript code: alert('Hello') + ' World!'; ?
alert('Hello') + ' World!';
An error message
World!
Hello World!
Hello
Which method is NOT a built-in JavaScript array method?
reverse()
sort()
find()
length()
Is it possible to have multiple 'catch' blocks associated with a single 'try' block?
Yes, to handle different error types specifically
Only if the 'try' block is nested inside another 'try'
Only if you re-throw the error inside the first 'catch'
No, you can only have one 'catch' per 'try'
Which keyword is used to define an arrow function in JavaScript?
=>
arrow
new
function
How can you change the text content of an HTML element using JavaScript?
element.innerHTML = 'New text'
element.innerText = 'New text'
All of the above
element.textContent = 'New text'
What is the correct syntax to add an event listener to an element?
element.addEventListener('click', functionName)
element.on('click', functionName)
element.attachEvent('click', functionName)
element.addListener('click', functionName)
What is the value of 'x' after the following code is executed?
let x = 5; if (x > 10) { x = 10; } else { x = 0; }
5
10
0
undefined
What is the purpose of the 'do-while' loop in JavaScript?
To skip the current iteration of a loop.
To execute a block of code at least once, and then repeatedly as long as a condition is true.
To execute a block of code only if a condition is true.
To declare a function.
How can you loop through the properties of an object myObject?
myObject
while (myObject.hasNext()) {...}
myObject.forEach(property => {...})
for (let key in myObject) {...}
for (let i = 0; i < myObject.length; i++) {...}