What does { …obj1, obj2 } do exactly [duplicate]
问题 This question already has answers here : What do these three dots in React do? (22 answers) Closed 8 months ago . Let's say we have two objects: const state = { fishes: { /* some obj data */ }, animals: { /* some obj data */ } const animals = { /* some NEW data */ } In Vuex there is a method replaceState(), which according to the documentation takes one argument and replaces the state with that object. What will be the result of the following: replaceState({ ...state, animals }) More