Calling a getter multiple times or calling once and assigning to a variable?

后端 未结 13 1725
无人共我
无人共我 2021-02-05 15:26

say suppose I have class as :

public class Age {

    private int age;

    public int getAge() {
       return this.age;
    }

}

In my Main c

13条回答
  •  孤独总比滥情好
    2021-02-05 15:52

    get attrs () {
        const elem = {
            'A' :   ${"[data-test='load-more-button']}
            'B' :   $$('[data-test="product-catalog-row"]'),
        }
        return elem
    } 
    

    Is it possible (at this line) to call the get() and assign it to a variable that can be passed to the funcs() rather than passing attrs = this.attr? The funcs are in the same files as the get(). What is the correct syntax?

    func1(attrs = this.attr){attr.A}
    func2(attrs = this.attr){attr.B}
    

提交回复
热议问题