Problem Input categories – an array of categories [ { id: 1, title: ‘Smartphones’ }, { id: 2, title: ‘Laptops’ […]
Tag: lodash.js
Group similar objects into array of arrays
Problem I have the following code, that groups similar todos into an array of arrays, using lodash (https://lodash.com). Here is […]
React debounce using Lodash
Problem I need people who have experience with React to review my code. I want to make a debounce using […]
Convert object array to hash map using lodash
Problem The use case is to convert an array of objects into a hash map where one property is the […]
Grouping, merging and mapping with a timetable
Problem I want to create a “timetable” for some shop. It should look like, “days – hours”. I get response […]
Generating an array of unique values of a specific property in an object array
Problem Given a table represented as a javascript array of objects, I would like create a list of unique values […]
Filter one array based on values of another, is this the best way?
Problem categories = [{id: “761601bc-4daf-4db2-a0cf-fe7f443fcb94”, name: “Shoes”},{id: “601ebcfe-fcbd-4075-a4b4-a42e356c5747”, name: “Hats”},{id: “238933cf-77a5-4443-b290-7d7c836f80ff”, name: “Eyewear”}]; voucher = {id:1,categories:[“761601bc-4daf-4db2-a0cf-fe7f443fcb94″,”601ebcfe-fcbd-4075-a4b4-a42e356c5747”]}; filterCategories(voucher) { const result […]
Get an object with null values from an array of nested objects
Problem I have an array of nested objects. How do I get an object with null values using only a […]
JavaScript function to convert an array to an array of strings (formatted)
Problem Input categories – an array of categories [ { id: 1, title: ‘Smartphones’ }, { id: 2, title: ‘Laptops’ […]
Function that groups rows returned from SQL DB
Problem I have a data set returned from an SQL database contained below, as you can see all data remains […]