Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 38a754c + 7c383d6 commit 2094f09Copy full SHA for 2094f09
04 - Array Cardio Day 1/index-FINISHED.html
@@ -75,8 +75,8 @@
75
// 7. sort Exercise
76
// Sort the people alphabetically by last name
77
const alpha = people.sort((lastOne, nextOne) => {
78
- const [aLast, aFirst] = lastOne.split(', ');
79
- const [bLast, bFirst] = nextOne.split(', ');
+ const [aFirst, aLast] = lastOne.split(', ');
+ const [bFirst, bLast] = nextOne.split(', ');
80
return aLast > bLast ? 1 : -1;
81
});
82
console.log(alpha);
0 commit comments