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.
1 parent 5029405 commit 3f1273cCopy full SHA for 3f1273c
04 - Array Cardio Day 1/index-FINISHED.html
@@ -81,8 +81,8 @@
81
// 7. sort Exercise
82
// Sort the people alphabetically by last name
83
const alpha = people.sort((lastOne, nextOne) => {
84
- const [aFirst, aLast] = lastOne.split(', ');
85
- const [bFirst, bLast] = nextOne.split(', ');
+ const [aLast, aFirst] = lastOne.split(', ');
+ const [bLast, bFirst] = nextOne.split(', ');
86
return aLast > bLast ? 1 : -1;
87
});
88
console.log(alpha);
0 commit comments