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.
Definietly B. YOu can incoke method like in presented on option A in LWC.
upvoted 2 times
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
M4JK3LSON
11 months ago