A new
B create
C instance
D class
Explanation: The 'new' keyword is used to create an instance of a class.
A true
B false
C undefined
D NaN
Explanation: The logical NOT operator reverses the boolean value, so !true is false.
A window.location.href
B document.URL
C location.href
D All of the above
Explanation: All of these methods can be used to get the current URL.
A 10
B 55
C NaN
D TypeError
Explanation: The number is coerced to a string, resulting in concatenation: '55'.
A toLowerCase()
B lowerCase()
C toLower()
D caseLower()
Explanation: toLowerCase() converts a string to lowercase letters.
Explanation: Multiplication has higher precedence, so 3 * 4 = 12, then 2 + 12 = 14.
A eval()
B parse()
C execute()
D run()
Explanation: eval() evaluates JavaScript code represented as a string.
A true
B false
C undefined
D TypeError
Explanation: === checks both value and type. 0 is a number, false is a boolean.
A Math.max()
B Math.max.apply()
C Math.max(...array)
D All of the above
Explanation: All of these methods can be used to find the maximum value in an array.
A function
B object
C undefined
D arrow
Explanation: Arrow functions are a type of function, so typeof returns 'function'.
A onsubmit
B submit
C formsubmit
D Both a and b
Explanation: Both 'submit' and 'onsubmit' can be used to handle form submissions.
Explanation: 10 divided by 3 leaves a remainder of 1.
A import
B require
C include
D Both a and b (depending on environment)
Explanation: import is used in ES modules, while require is used in CommonJS.
A 6
B 23
C NaN
D TypeError
Explanation: The string '3' is coerced to a number, so 2 * 3 = 6.
A toUpperCase()
B upperCase()
C toUpper()
D caseUpper()
Explanation: toUpperCase() converts a string to uppercase letters.
A 3
B 52
C NaN
D TypeError
Explanation: The string '5' is coerced to a number, so 5 - 2 = 3.
A Object.defineProperty()
B Object.assign()
C Dot notation or bracket notation
D All of the above
Explanation: All of these methods can be used to add properties to an object.
A true
B false
C undefined
D NaN
Explanation: 3 > 2 is true (1), then 1 > 1 is false.
A window
B global
C Both a and b
D timer
Explanation: In browsers, window has timer functions; in Node.js, global has them.
Explanation: 1 + 2 + 3 = 6, then 6 + '4' = '64' (string concatenation).