The groceries map

Report a typo

Emma needs to go to the supermarket, and she has created a map groceries that contains the items she needs to buy:

groceries := map[string]int{
    "toothpaste":      1,
    "shampoo":         1,
    "soap":            2,
    "chicken breasts": 3,
    "potatoes":        2,
}

When she arrived at the supermarket, she remembered that some guests were coming for dinner today, so she decided to buy 8 potatoes instead of 2.

Which code line would allow her to update the value of potatoes from 2 to 8 in the groceries map?

Select one option from the list
___

Create a free account to access the full topic