Skip to main content
0 votes
0 answers
41 views

I need the most efficient way to calculate the total quantity for each base item by going through a list of cart items and sum up the quantities for all cart items having the same base item. My ...
Arnaw Gundawar's user avatar
0 votes
1 answer
74 views

Here are the instructions: Pretend that there is no Array.filter() method. Use Array.reduce() to filter out only the objects from the provided array with a price property of 10 or over. Pretend ...
aw_codes's user avatar
1 vote
0 answers
47 views

I've got a two-dimensional array: $array = [ ['property', 'group1', 'was', 'added'], ['property', 'ouch', 'was', 'removed'], ['property', 'ouch', ...
Artem Pokhiliuk's user avatar
0 votes
1 answer
242 views

I have multidimensional array and I want to sum all the same value with a certain condition. Here's what my array looks like $input_taxes = [ [ "tax_account_id" => 65, ...
Angel's user avatar
  • 989
1 vote
1 answer
68 views

I'm trying to understand how the reduce method work. The groupBy function only return object that is grouped by category. How do I get the wanted result below? I have tried many ways but none works. ...
DanNg's user avatar
  • 70
0 votes
1 answer
1k views

I'm creating a generic function that gets properties from an object using array.reduce. I would like the return type to only return the type of properties extracted from the original object type ...
CRIS's user avatar
  • 356
1 vote
1 answer
868 views

I have an "object of objects of arrays" and I simply need to get the total count of elements in the "bottom level" arrays ...so with the example below, I need to return 19 (...
ashleedawg's user avatar
  • 21.9k
0 votes
5 answers
2k views

In the program, I fetch arrays of products from orders via API. The array contains a list with products that are duplicated. I need to remove the duplicate products in the array and sum their ...
iNeeR's user avatar
  • 9

15 30 50 per page