x instanceof HogeClass - Literal typeʹ͓͚Δಉ֬ೝʢ if (x === “some message”) ʣ - obj.x obj[“x”] x in objͳͲͷଘࡏ֬ೝ - User Defined Type Guard function: function fn(x: any): x is { msg: string } { return x.msg && typeof x.msg === "string"; } 68
Supar type Sub type type SomeString string type SomeString = "some string"; const x: SomeString = "some string"; const y: string = x; const z = y as SomeString;