@Input() a: number;
// Check of null or undefined
if (a)
// do stuff
With the usual check, the value 0 will also be considered as false and the variable will not pass the if.
There is already a lot of questions around this but I could not find anything that handles the value zero.
Is there anything like the a?.b
of typescript but for simple type?