From 3f1273c7ca0ccf87b758e9884c41fa29cebe2e5f Mon Sep 17 00:00:00 2001 From: Piotr Berebecki Date: Sun, 18 Dec 2016 16:17:52 +0000 Subject: [PATCH] Fix the order in the sort exercise --- 04 - Array Cardio Day 1/index-FINISHED.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/04 - Array Cardio Day 1/index-FINISHED.html b/04 - Array Cardio Day 1/index-FINISHED.html index e61b94c006..ede883f1f9 100644 --- a/04 - Array Cardio Day 1/index-FINISHED.html +++ b/04 - Array Cardio Day 1/index-FINISHED.html @@ -81,8 +81,8 @@ // 7. sort Exercise // Sort the people alphabetically by last name const alpha = people.sort((lastOne, nextOne) => { - const [aFirst, aLast] = lastOne.split(', '); - const [bFirst, bLast] = nextOne.split(', '); + const [aLast, aFirst] = lastOne.split(', '); + const [bLast, bFirst] = nextOne.split(', '); return aLast > bLast ? 1 : -1; }); console.log(alpha);