Closed
Description
Code
interface A {
id?: number;
}
const a:A = {
id: 5
};
const testA: boolean = (a === 1); //works, but why?
interface B {
id: number;
}
const b:B = {
id: 5
};
const testB: boolean = (b === 1); //compiler error -> expected that also on A
Expected behavior:
An error on the compare line.
Actual behavior:
No error
Related Issues: