I have 2 object, one takes person details and other one takes address details via form. And each object has 3 fields. Now, before I send this to my parent, I need an check if condition these 2 objects are not undefined or null
I have tried these conditions and all fail:
=> !(this.person)&&!(this.address)
=> this.person !=(null || undefined)
I know that I can also compare each property of the object to null or undefined but can't write 6 conditions, because it breaches coding standards.
So guys please help me with this
Its not really and Angular things its more to do with Javascript. A double equal to null will return true if its null or undefined.
if (someValue == null) {
// Do something if null or undefined
}
This table should help.

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With