ES6 grammar problems

see a code like this,

would like to ask,

this.state = {
    data: []
} 

and

this.ResultArray = [];

what"s the difference

Mar.09,2021

makes no difference, they all assign values to attributes, but this.state assignments are multi-level objects, this.ResultArray arrays.


doesn't understand what you're asking. Just initialize the assignment. The type of


ResultArray is an array, while the type of state is an object whose data property is an array. In essence, it is that the data type is different. Is that what you want to ask

?
Menu