You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+30Lines changed: 30 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1018,3 +1018,33 @@ Since a and b reference the same array, both console.log(a) and console.log(b) w
1018
1018
This is different from the previous example where ... spread operator was used, which created a new array with the same values as the original array instead of referencing the same array.
1019
1019
1020
1020
</details>
1021
+
1022
+
<details>
1023
+
<summary>
1024
+
<h3>34. What is the output of the following code?</h3>
The comparison function takes two parameters, "a" and "b", which represent two elements being compared in the array. If the "name" property of "a" comes before the "name" property of "b" in alphabetical order, then the function returns -1, which means "a" should come before "b" in the sorted array. Otherwise, if the "name" property of "a" comes after the "name" property of "b" in alphabetical order, then the function returns 1, which means "b" should come before "a" in the sorted array.
0 commit comments