Skip to content

Commit 2094f09

Browse files
authored
Merge pull request wesbos#28 from mvaneijgen/patch-1
04 - Array Cardio Day 1, 7. sort Exercise | make it so it sorts on last name
2 parents 38a754c + 7c383d6 commit 2094f09

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@
7575
// 7. sort Exercise
7676
// Sort the people alphabetically by last name
7777
const alpha = people.sort((lastOne, nextOne) => {
78-
const [aLast, aFirst] = lastOne.split(', ');
79-
const [bLast, bFirst] = nextOne.split(', ');
78+
const [aFirst, aLast] = lastOne.split(', ');
79+
const [bFirst, bLast] = nextOne.split(', ');
8080
return aLast > bLast ? 1 : -1;
8181
});
8282
console.log(alpha);

0 commit comments

Comments
 (0)