I have an array as such
const arr = [a={} , b={}]
Now I know the spread operator is not for mutation or pushing but it is very easy to do so with.
I want this button to add elements to a when it's pressed
<Button
title= {this.props.title}
onPress={ this.roomNumberPressed }
/>
so the end results be something like :
arr = [a={1,2,3} , b={3,4,5}]
...isn't, and can't be, an operator, neither when used for spread nor rest. It does things operators cannot do. Details.const arr = [a={} , b={}]isn't valid syntax. Do you have an array, or an object withaandbproperties?{a: [], b: []}?