Skip to content

Commit 8e613bc

Browse files
authored
Merge pull request #2185 from vsemozhetbyt/patch-9
Make a solution of 1.5.5 task more correct
2 parents 35f47b9 + 3188466 commit 8e613bc

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 sortByAge(arr) {
3-
arr.sort((a, b) => a.age > b.age ? 1 : -1);
3+
arr.sort((a, b) => a.age - b.age);
44
}
55

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

0 commit comments

Comments
 (0)