📅  最后修改于: 2022-03-11 14:48:31.945000             🧑  作者: Mango
enum UserResponse {
No = 0,
Yes = 1,
}
function respond(recipient: string, message: UserResponse): void {
console.log(recipient, message); // "Princess Caroline", 1
}
respond("Princess Caroline", UserResponse.Yes);