My code is failing here at this part ..i cant understand what is the role of this && operator in js?
export function calculateLineTotals(line, invoice) {
let totals = _calculateLineTotals(line, invoice)
return {
amount: totals.amount &&
totals.amount.decimalPlaces(2).toNumber(),
vatRate: totals.vatRate &&
totals.vatRate.decimalPlaces(2).toNumber(),
grossAmount: totals.grossAmount &&
totals.grossAmount.decimalPlaces(2).toNumber(),
vatAmount: totals.vatAmount &&
totals.vatAmount.decimalPlaces(2).toNumber(),
}