if (fooOrBar instanceof Foo){ // TypeScript now knows that `fooOrBar` is `Foo` } ... TypeScript answers related to “typescript check type of variable”.
確定! 回上一頁