What is the correct way to add a new property 'city' with value 'New York' to the object person from the previous question?
person
person['city'] = 'New York'
Object.assign(person, {city: 'New York'})
person.push('city', 'New York')
person.city = 'New York'
What is the result of the expression: 10 % 3?
10 % 3
0
3
1
10
What will be logged to the console?
function outer() { let x = 5; function inner() { console.log(x); } return inner; } const myFunc = outer(); myFunc();
5
ReferenceError
null
undefined
What will be the output of the following code?
console.log(typeof null);
symbol
object
Which of the following is NOT a feature of JavaScript?
Strongly typed language
Client-side scripting language
Object-oriented programming capabilities
Interpreted language
Which operator is used to check for strict equality (value and type) in JavaScript?
==
=
===
!=
What is the difference between the 'break' and 'continue' statements in a loop?
'break' and 'continue' both skip the current iteration.
'break' and 'continue' both exit the loop entirely.
'break' exits the loop entirely, while 'continue' skips the current iteration and continues with the next.
'break' skips the current iteration, while 'continue' exits the loop entirely.
In JavaScript, what does it mean for a function to have a closure?
It can access its own parameters.
It can be passed as an argument to other functions.
It can access variables from its surrounding scope, even after the outer function has finished executing.
It can modify global variables.
Which tool in the browser's developer tools is most commonly used for debugging JavaScript code?
Network Tab
Console
Application Tab
Elements Panel
What is the difference between a function declaration and a function expression in JavaScript?
Function expressions are hoisted, while function declarations are not.
Function declarations can only be anonymous.
There is no difference; they are interchangeable.
Function declarations are hoisted, while function expressions are not.