好几次因为疏忽导致的 bug 都没发现,类似这样的疏忽,而且没有警告,往往很久后才发现。 function someBol(): boolean { return true } if (someBol) { doSomething() } somebol, 疏忽, 布尔值, boolean
打开 strictNullChecks 试试? This condition will always return true since this function is always defined. Did you mean to call it instead?ts(2774)