Merge pull request #2185 from vsemozhetbyt/patch-9
Make a solution of 1.5.5 task more correct
This commit is contained in:
commit
8e613bc62c
1 changed files with 1 additions and 1 deletions
|
@ -1,6 +1,6 @@
|
||||||
```js run no-beautify
|
```js run no-beautify
|
||||||
function sortByAge(arr) {
|
function sortByAge(arr) {
|
||||||
arr.sort((a, b) => a.age > b.age ? 1 : -1);
|
arr.sort((a, b) => a.age - b.age);
|
||||||
}
|
}
|
||||||
|
|
||||||
let john = { name: "John", age: 25 };
|
let john = { name: "John", age: 25 };
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue