🗓️ Daily LeetCoding Challenge Day 24|| 🔥 JS SOL
\n# Code\n\nvar sortBy = function(arr, fn) {\n    return arr.sort((a, b) => fn(a) - fn(b));\n};\n
\n# Code\n```\nvar sortBy = function(arr, fn) {\n    return arr.sort((a, b) => fn(a) - fn(b));\n};\n```
['JavaScript']