update array of objects without mutate state

前端 未结 0 358
一整个雨季
一整个雨季 2021-02-08 10:31

I need to update this array so the result is as below without causing mutation to it.

From this:

var cart = [
  {
    customerId: "1",
    items:         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题