`is` 키워드는 타이프 스크립트에서 무엇을합니까? 다음과 같은 코드를 발견했습니다. export function foo(arg: string): arg is MyType { return ... } 나는 is문서 나 구글에서 검색 할 수 없었다 . 꽤 흔한 단어이며 기본적으로 모든 페이지에 나타난다. 그 맥락에서 키워드는 무엇을합니까? function isString(test: any): test is string{ return typeof test === “string”; } function example(foo: any){ if(isString(foo)){ console.log(“it is a string” + foo); console.log(foo.length); // string function ..