I had not come across such a notation:
public station function(a: number, sort?: { order: -1 | 1; sortBy: string }[] ){ //function body here }
Specifially I'm interested in the sort parameter.
I can only understand that sort
is an optional argument (I can't even say for sure if it's an object literal since there's no ,
).
What does this syntax read? What type of variable is it? Why is there a ;
instead of a ,
(BTW that is not a typo). What does {...}[]
indicate?
没有评论:
发表评论