A developer is building a Lightning web component that displays quantity, unit price, and the total for an order line item. The total is calculated dynamically as the quantity multiplied by the unit price. What must be added to display the total?
A. Add calculateTotal() { return quantity * unitPrice; } to the JavaScript and Total: {calculateTotal()}in the template.
B. Add get total() { return quantity * unitPrice; } to the JavaScript and Total: {total} in the template.
C. Add Total: {multiply{quantity, unitPrice}} in the template.
D. Add Total: {quantity * unitPrice} in the template.
Suggest answer: A
Reference:
No comments:
Please share to make the community better.