Skip to content

Commit 3f1273c

Browse files
Fix the order in the sort exercise
1 parent 5029405 commit 3f1273c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

04 - Array Cardio Day 1/index-FINISHED.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@
8181
// 7. sort Exercise
8282
// Sort the people alphabetically by last name
8383
const alpha = people.sort((lastOne, nextOne) => {
84-
const [aFirst, aLast] = lastOne.split(', ');
85-
const [bFirst, bLast] = nextOne.split(', ');
84+
const [aLast, aFirst] = lastOne.split(', ');
85+
const [bLast, bFirst] = nextOne.split(', ');
8686
return aLast > bLast ? 1 : -1;
8787
});
8888
console.log(alpha);

0 commit comments

Comments
 (0)