how to change pass by value to pass by reference typescript code example
Example: javascript pass by reference
function add(a, b, output) {
output.out = a + b;
}
var output = {};
add(5, 3, output);
console.log(output); //output: {out: 8}
function add(a, b, output) {
output.out = a + b;
}
var output = {};
add(5, 3, output);
console.log(output); //output: {out: 8}