Which of the following is NOT a feature of JavaScript?
Strongly typed language
Object-oriented programming capabilities
Client-side scripting language
Interpreted language
What will the browser display after running this JavaScript code: alert('Hello') + ' World!'; ?
alert('Hello') + ' World!';
World!
An error message
Hello World!
Hello
Which of the following is NOT a popular JavaScript framework/library?
React
Java
Angular
Vue.js
What is the correct syntax to add an event listener to an element?
element.attachEvent('click', functionName)
element.addListener('click', functionName)
element.on('click', functionName)
element.addEventListener('click', functionName)
What does the querySelector() method return when it finds multiple matching elements in the DOM?
querySelector()
null
An array of all matching elements
The last matching element
The first matching element
In JavaScript, how can you access the value of the arguments passed to a function?
By accessing function parameters directly.
Using the 'params' array.
Using the 'arguments' object.
Through the 'this' keyword.
Which method is NOT a built-in JavaScript array method?
length()
sort()
reverse()
find()
What is the correct way to add an element 'apple' to the end of the array fruits = ['banana', 'orange']?
fruits = ['banana', 'orange']
fruits.unshift('apple')
fruits = ['apple']
fruits.push('apple')
fruits[2] = 'apple'
What is the output of the following JavaScript code: prompt('Enter your name:', 'John Doe');?
prompt('Enter your name:', 'John Doe');
It prints 'Enter your name: John Doe' to the console.
It displays a dialog box with the message 'Enter your name:' and a default input value 'John Doe', returning the user's input as a string.
It creates an alert box with the message 'Enter your name: John Doe'.
It sets the user's name to 'John Doe' in the browser's local storage.
What does 'client-side' JavaScript refer to?
JavaScript code executed on the user's web browser
JavaScript code used for server maintenance
JavaScript code executed on a web server
JavaScript code used for database management