A trim()
B strip()
C trimStart()
D trimEnd()
Explanation: trim() removes whitespace from both ends of a string.
Explanation: The modulo operator returns the remainder of 5 divided by 2, which is 1.
A break
B continue
C return
D skip
Explanation: continue skips the current iteration and moves to the next one.
A number
B bigint
C object
D undefined
Explanation: The 'n' suffix indicates a BigInt, which is a separate primitive type.
A concat()
B merge()
C join()
D push()
Explanation: concat() is used to merge two or more arrays into a new array.
Explanation: The && operator returns the first falsy value. 1 is truthy, so 0 is returned.
A size
B length
C count
D index
Explanation: The length property returns the number of elements in an array.
A true
B false
C undefined
D TypeError
Explanation: The == operator performs type coercion, so 2 == '2' is true.
A findIndex()
B indexOf()
C find()
D Both a and b
Explanation: Both indexOf() and findIndex() can be used to find an element's index.
A true
B false
C undefined
D NaN
Explanation: Strings are compared lexicographically. 'a' has a smaller Unicode value than 'b'.
A call()
B apply()
C bind()
D All of the above
Explanation: call(), apply(), and bind() all allow setting the 'this' context.
A 0.3
B 0.30000000000000004
C 0.30000000000000004
D 0.30000000000000004
Explanation: Due to floating-point precision, 0.1 + 0.2 results in 0.30000000000000004.
A setTimeout()
B setInterval()
C setRepeat()
D setRecurring()
Explanation: setInterval() repeatedly executes a function at specified intervals.
A true
B false
C undefined
D TypeError
Explanation: [] is coerced to '' and then to 0, so [] == 0 is true.
A firstChild
B firstElementChild
C childNodes[0]
D All of the above
Explanation: All of these methods can access the first child of a node.
A true
B false
C undefined
D NaN
Explanation: Both conditions are true, so the logical AND returns true.
A toString()
B String()
C valueOf()
D Both a and b
Explanation: Both toString() and String() can convert a number to a string.
A true
B false
C undefined
D NaN
Explanation: typeof null returns 'object', so the comparison is true.
A load
B DOMContentLoaded
C ready
D Both a and b
Explanation: Both load and DOMContentLoaded events are used to handle page loading.
A 1
B 21
C NaN
D TypeError
Explanation: The string '2' is coerced to a number, so 2 - 1 = 1.