What does 'client-side' JavaScript refer to?
JavaScript code executed on a web server
JavaScript code used for database management
JavaScript code executed on the user's web browser
JavaScript code used for server maintenance
What is the scope of a variable declared inside a function in JavaScript?
Global scope
Block scope
Function scope
Local scope
What will be logged to the console?
function outer() { let x = 5; function inner() { console.log(x); } return inner; } const myFunc = outer(); myFunc();
ReferenceError
undefined
null
5
What will the following code snippet log to the console: console.log((function(x) { return x * 2; })(5));
console.log((function(x) { return x * 2; })(5));
10
What is the correct syntax to add an event listener to an element?
element.attachEvent('click', functionName)
element.addListener('click', functionName)
element.addEventListener('click', functionName)
element.on('click', functionName)
Which event is fired when a user clicks on an HTML element?
onmouseover
onclick
onload
onmousedown
What value is returned by confirm('Are you sure?') if the user clicks the 'Cancel' button?
confirm('Are you sure?')
false
true
Which tool in the browser's developer tools is most commonly used for debugging JavaScript code?
Network Tab
Console
Application Tab
Elements Panel
How do you access the value associated with the key 'name' in the object person = {name: 'John', age: 30}?
person = {name: 'John', age: 30}
person[0]
person.name
person['name']
person.get('name')
What is the role of 'server-side' JavaScript?
Styling web pages with CSS
Processing data and interacting with databases
Handling user input on a web page
Creating animations and visual effects in the browser