A parseInt()
B parseFloat()
C Number()
D Both a and c
Explanation: parseInt() parses a string and returns an integer. Number() can also parse integers.
A undefined
B null
C object
D NaN
Explanation: typeof undefined returns 'undefined'.
A Array.from()
B Array.of()
C Array.create()
D Array.new()
Explanation: Array.from() creates a new array from an iterable or array-like object.
A h
B e
C hello
D undefined
Explanation: charAt(0) returns the character at index 0, which is 'h'.
A in
B hasOwnProperty
C typeof
D Both a and b
Explanation: The 'in' operator and hasOwnProperty() both check for property existence.
A true
B false
C undefined
D TypeError
Explanation: 0 is loosely equal to false (both are falsy).
A new Date()
B Date.now()
C new Date().getTime()
D All of the above
Explanation: All of these methods can be used to get the current date and time.
A 4
B 22
C NaN
D TypeError
Explanation: String concatenation occurs, resulting in '22'.
A slice()
B concat()
C Array.from()
D All of the above
Explanation: All these methods can create shallow copies of an array.
Explanation: 1 + 2 = 3, then 3 + '3' = '33' (string concatenation).
A const
B let
C var
D final
Explanation: const is used to declare a constant (read-only) variable.
A []
B ''
C undefined
D TypeError
Explanation: Empty arrays are coerced to empty strings, so '' + '' = ''.
A Math.ceil()
B Math.floor()
C Math.round()
D Math.trunc()
Explanation: Math.floor() returns the largest integer less than or equal to the number.
A true
B false
C undefined
D NaN
Explanation: 0 is falsy, so !!0 returns false.
A onclick
B click
C mouseclick
D Both a and b
Explanation: Both 'click' and 'onclick' are used to handle click events.
Explanation: 3 + '3' = '33', then '33' - 1 = 32 (string coerced to number).
A includes()
B contains()
C has()
D indexOf()
Explanation: includes() is used to check if an array contains a specific element.
A 0
B Hello
C true
D false
Explanation: The || operator returns the first truthy value. 0 is falsy, so 'Hello' is returned.
A innerHTML
B outerHTML
C textContent
D All of the above
Explanation: innerHTML is most commonly used to get or set the HTML content of an element.
A true
B false
C undefined
D TypeError
Explanation: 'JavaScript' is a primitive string, not a String object, so it returns false.