how to make a class that can be initialized using object or regular parameter constructor in Typescript?

后端 未结 0 535
名媛妹妹
名媛妹妹 2021-02-06 10:46

so I want to make a class that can be initialized in two ways.

first, by using regular parameter, like this

class User {
    name: string
    age: number

         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题