I have created recursive (rec) function inside setBinary method in typescript. But some reason it is not working in typescript but working in Angular.
How to convert the following angular to typescript.
While running gives an error "rec is not a function"
setBinary(rowId, vId, data) {
let pri;
let pvi;
let rec;
rec (pri, pvi) {
let latest = [];
if (this.copyColumns[pri]) {
this.copyColumns[pri].values[pvi].active = true;
let x = this.copyColumns[pri].values[pvi]
rec(x.pri, x.pvi)
}
};
rec(data.pri, data.pvi)
}
recmust be declared a function, if this code is to run in either typescript or javascript