In my application, I have the following code.
if (values && (values.cardNumber !== undefined)) {
But I have seen in some places where it looks something like this.
if (values && typeof (values.cardNumber !== 'undefined')) {
Which is the better and more secure approach to check if something is undefined??