typeof 或 instanceof 不健全的类型防护检查。
在以下两种情况下,typeof x 类型防护可能不健全:
typeof x 不对应于指定的值(例如,当 x 为 'string | boolean' 类型时,typeof x === 'number')typeof x 始终对应于指定的值(例如,当 x 为 'string' 类型时,typeof x === 'string')x instanceof A 类型防护可能不健全:
x 的类型与 A 不相关x 的类型是 A 或 A 的子类型