Object Entries and fromEntries
Entries from Entries
π¨βπΌ We need to apply a discount to all prices in our catalog and return a new
object with updated values.
π¨ Open
and:
- Use
Object.entriesto get the catalog entries - Use
mapto apply a 10% discount to each price - Use
Object.fromEntriesto build the discounted object
- π MDN - Object.entries
- π MDN - Object.fromEntries