I (cringingly) wrote something like this in an API test the other day:

function expectedAmount(body) {
return body
.ResponseInformation
.ResponseInformationCore
.ResponseSellerAvails
.ResponseSellerAvail[0]
.SellerAvail
.AvailCore
.Totals
.Total[0]
.Charges
.Charge[0]
.calculation[0]
.amount
}

I figured someone would appreciate the ugliness as much as I do. Any suggestions on making it more pretty?

submitted by /u/jfacoustic
[link] [comments]