Skip to content

Commit 76c12f4

Browse files
authored
Сортировка
1 parent f331595 commit 76c12f4

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 vasya = { name: "Вася", age: 25 };

0 commit comments

Comments
 (0)