I need to iterate the next value from an array of an array in every function call.
forex: If I have an array of array
const Arr = [ ['1','2', '3'], ['11','12', '13'], ['11','22', '33'],]
and I have a function
getNumber(id: number): string {
let n;
for(const i in Arr) {
for(const j in Arr[i]{
n = j;
}
}
return n;
}
and I here I need to call the function multiple times but every Time It should return the next number
let i = 4;
for(let j=0; j<=i; j++) {
const g = {
number: this.getNumber(i); //this i means id
}
}
after the calling function, it will return like
'1'
'2'
'3'
'11'
'12'
please help me to solve this