Why this code not working?
I try save the array return of the function public "xy" in variables publics directly as in the function list() in php.
data = function() {
this.xy = function() {
return ['AAA', 'BBB'];
}
[this.x, this.y] = this.xy(); // Not Work
}
a = new data();
console.log(a.x)
output: 'error: TypeError: this.xy is not a function'