Consider the following arrays. What gets logged in various sorting conditions?
const arr1 = ['a', 'b', 'c'];
const arr2 = ['b', 'c', 'a'];
console.log(
arr1.sort() === arr1,
arr2.sort() == arr2,
arr1.sort() === arr2.sort()
);
A) true true true
B) true true false
C) false false false
D) true false true
Put your answer in the comments!
Oldest comments (19)
B
D?
D
B
B
B
I guess the correct answer is B
B
B
B, morning coffee does wonders.
Some comments may only be visible to logged-in visitors. Sign in to view all comments.