I am trying to write a TypeScript function something like this:
import multipleActionObject from page;
it("should be able to do multiple operations", () => {
multipleActionObject.chooseIndex(4).setValue(10);
}
I would like to write a function like that instead of:
import multipleActionObject from page;
it("should be able to do multiple operations", () => {
multipleActionObject.chooseAndSetNumber(4,10);
}
In my multipleActionObject
class:
class multipleActionObject(){
public chooseAndSetNumber(index,value){
this.index[index].setValue(value)
}
}
How do I write a helper for the first option?