I attempted to implement the solution provided by Pacerier in response to the question about skipping arguments in a JavaScript function. However, it doesn't seem to be working for me.
The function I am dealing with has numerous arguments.
this.service.list("all",null, null, localStorage.getItem('currentProgram'), null, 100, ...Array(2), environment.liveMode).subscribe(...)
My only workaround so far has been to manually write out each argument one by one, such as (,null, null or undefined,undefined).
I even created a test method to experiment with, but unfortunately, that didn't yield any successful results either.
test(a: any, b: any, c: any, d: string) {
console.log(d)
}
ngOnInit() {
this.test(...Array(3), "a")
}
I also tested other syntax options mentioned in the answer.
Is there a more concise way to achieve this in TypeScript?