Update solution.md

This commit is contained in:
Ilya Kantor 2018-12-15 18:59:38 +03:00 committed by GitHub
parent 23b5766b82
commit 7a23ea1052
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,6 +1,6 @@
```js run no-beautify ```js run no-beautify
function sortByName(arr) { function sortByName(arr) {
arr.sort((a, b) => a.name > b.name); arr.sort((a, b) => b.name > a.name ? 1 : -1);
} }
let john = { name: "John", age: 25 }; let john = { name: "John", age: 25 };