📌  相关文章
📜  typescript "variable?: type" 表示法 - TypeScript 代码示例

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

代码示例2
// Writing ! after any expression is effectively a type assertion 
// that the value isn’t null or undefined
function liveDangerously(x?: number | null) {  // No error  console.log(x!.toFixed());}Try