Skip to content

Commit 5aa6cdc

Browse files
authored
Merge pull request #31 from maangie/master
2 parents 9efb98a + 951aae2 commit 5aa6cdc

File tree

1 file changed

+1
-1
lines changed
  • 1-js/05-data-types/05-array-methods/8-sort-objects

1 file changed

+1
-1
lines changed

1-js/05-data-types/05-array-methods/8-sort-objects/solution.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
```js run no-beautify
22
function sortByName(arr) {
3-
arr.sort((a, b) => a.name > b.name);
3+
arr.sort((a, b) => b.name > a.name ? 1 : -1);
44
}
55

66
let john = { name: "John", age: 25 };

0 commit comments

Comments
 (0)