The TypeScript code currently looks like this:
callSomeMethod(data){
let test2 : CommonModel[] = [{ name: 'testing'}];
data = test2;
console.log('data');console.log(data);
}
testRef(){
let test : CommonModel[] = [];
this.callSomeMethod(test);
console.log('test');console.log(test);
}
I have a variable named 'test' that is of object/array type. I pass it as a parameter and call the method callSomeMethod(). I want to update this 'test' variable within the method.
However, after the method call finishes, the result is still empty.
How can I correctly retrieve the updated value?