Skip to content

Commit 9cab434

Browse files
day 24 task complete
1 parent 8bde8ac commit 9cab434

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

day24/leetcode2724.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// 2724. Sort By
2+
// URL -> https://leetcode.com/problems/sort-by/
3+
4+
/**
5+
* @param {Array} arr
6+
* @param {Function} fn
7+
* @return {Array}
8+
*/
9+
var sortBy = function (arr, fn) {
10+
return arr.sort((a, b) => fn(a) - fn(b))
11+
};

0 commit comments

Comments
 (0)