For : abc:number|string;. Use the JavaScript operator typeof : if (typeof abc === "number") { // do something }. TypeScript understands ...
確定! 回上一頁