Easiest way to check for null and empty string on a TypeScript number
To excludes blank strings as well
if(this.retailPrice && this.retailPrice.trim()){
//Implement your logic here
}
You can simply use typeof. It will check undefined, null, 0 and "" also.
if(typeof RetailPrice!='undefined' && RetailPrice){
return this.RetailPrice;
}