Object Keys and Values

Keys Values
πŸ‘¨β€πŸ’Ό We have a small inventory object and need to extract the names and quantities for reporting.
🐨 Open
index.ts
and use the provided inventory fixture:
  1. Create itemNames using Object.keys β€” expected order: ['apples', 'oranges', 'bananas', 'mangoes']
  2. Create quantities using Object.values β€” expected order: [12, 8, 0, 4]
  3. Create totalQuantity by summing quantities (expected 24, including the 0 for bananas)
  4. Export itemNames, quantities, and totalQuantity

Please set the playground first

Loading "Object Keys and Values"
Loading "Object Keys and Values"