0👍
You should change the way you define groceryList
. When you have the same key text
in your object, the last value rewrites all preceding.
As a result, your groceryStore
is equal to [{"text":"SALAD"}]
Put names into an array, or give uniq keys for your items.
Source:stackexchange.com