Skip to content

JS30

Sort By - 2724

Sort By – 2724

🔗LC2724 🟢 Easy 🧩 Pattern – JSON, Arrays and JS Sort 📅 Day 24/30 Days of JavaScript Given an array arr and a function fn, return a sorted array sortedArr. You can assume fn only returns numbers and those numbers determine the sort order of sortedArr. sortedArr must be sorted in ascending order… Read More »Sort By – 2724

Group By - 2631

Group By – 2631

🔗LC2631 🟡 Medium 🧩 Pattern – JSON, Objects and Arrays 📅 Day 23/30 Days of JavaScript Write code that enhances all arrays such that you can call the array.groupBy(fn) method on any array and it will return a grouped version of the array. A grouped array is an object where each key is the output of… Read More »Group By – 2631

Chunk Array - 2677

Chunk Array – 2677

🔗LC2677 🟢 Easy 🧩 Pattern – JSON and Arrays 📅 Day 21/30 Days of JavaScript Given an array arr and a chunk size size, return a chunked array. A chunked array contains the original elements in arr; but consists of subarrays each of length size. The length of the last subarray may be less than the size of arr.length is not… Read More »Chunk Array – 2677

Is Object Empty - 2727

Is Object Empty – 2727

🔗LC2727 🟢 Easy 🧩 Pattern – JSON and Objects 📅 Day 20/30 Days of JavaScript Given an object or an array, return if it is empty. You may assume the object or array is the output of JSON.parse. Example Solution