How can we access different arrays based on the parameters passed?
public array1: Array<any> = ['list', 'of','array1'];
public array2: Array<any> = ['list', 'of','array2'];
public array3: Array<any> = ['list', 'of','array3'];
public array4: Array<any> = ['list', 'of','array4'];
public array5: Array<any> = ['list', 'of','array5'];
public array6: Array<any> = ['list', 'of','array6'];
ngOnInit(): void {
this.useArray(param);
}
useArray(param) {
//if param is array6
passTheArray(this.array6);
}
The chosen array will then be sent to another service for further processing.