📜  typescript 命名 return - TypeScript 代码示例

📅  最后修改于: 2022-03-11 14:48:25.033000             🧑  作者: Mango

代码示例1
// The closest thing to a named return is
// defining a type and using it immediately
type Total = number
type Product = number
function stats(vals: number[]): [Total, Product] {
    ...
}