Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expenditure-analysis.js only allows a specific name for Total Price spent in output #67

Open
Ni-011 opened this issue Jun 14, 2023 · 1 comment

Comments

@Ni-011
Copy link

Ni-011 commented Jun 14, 2023

In JS easy question 2 expenditure analysis, it requires a specific property name for the total amount in output object that is 'totalSpent' but the question doesn't hint it, if you make the entire program right and name the property something else it yields error and all test cases are passed on using the name 'totalSpent' in the output price but this isn't mentioned in question which tells to use 'total_amount_spent'

@sushant0709
Copy link

Also, I feel the description of the question is not clear. After reading the description, I comprehended that the output list should be of the following form for this particular example (after seeing the line-> Output - [{ category1 - total_amount_spent_on_category1 }, { category2 - total_amount_spent_on_category2 }]) :
Ex: Input:
{
id: 1,
timestamp: 1656076800000,
price: 10,
category: 'Food',
itemName: 'Pizza',
},
{
id: 2,
timestamp: 1656259600000,
price: 20,
category: 'Food',
itemName: 'Burger',
},
{
id: 3,
timestamp: 1656019200000,
price: 15,
category: 'Clothing',
itemName: 'T-Shirt',
},
{
id: 4,
timestamp: 1656364800000,
price: 30,
category: 'Electronics',
itemName: 'Headphones',
},
{
id: 5,
timestamp: 1656105600000,
price: 25,
category: 'Clothing',
itemName: 'Jeans',
},

  Output:
  
  [{Food: 30}, {Clothing: 40}, {Electronics: 30}] 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants