Declaring multiple TypeScript variables with the same type

后端 未结 11 1333
半阙折子戏
半阙折子戏 2020-12-10 00:09

I\'m coding a large TypeScript class and I\'ve set noImplicitAny to true. Is there any way to declare multiple variables of the same type on the same line?

I\'d lik

11条回答
  •  盖世英雄少女心
    2020-12-10 01:00

    There is no real way to achieve what you want. If your only goal is to compress everything onto one line, you can do the following:

    public AcccountNumber: number;public branchCode:number;
    

    …but I wouldn't recommend it.

提交回复
热议问题