What about the case where most products don’t have offerings, or the offerings don’t have merchants, vel cetera? If this were a frequent case, and this were inner-loop code, I might introduce a global empty object in order to reduce the object instantiation overhead (which happens right away) and the GC load (which shows up over time). E.g. define var $N={}, and use:
var product = ...,
merchantName = (((product||$N).offering||$N).merchant||$N).name;
if (merchantName)
displayMerchantName(merchantName);
Group items matching
in title, tags, annotations or url
1More
The Most Excellent Bookkeeping Services - 1 views
1 - 8 of 8
Showing 20▼ items per page