cd .. (all tools)

Diff

Compare two texts or two JSON documents.

// Runs in your browser. Nothing you type here is sent anywhere.

Compare as

Differences

3 added, 3 removed.

Line in the originalLine in the changed textChangeLine
1removedfunction total(items) {
1addedfunction total(items, taxRate = 0.21) {
22 let sum = 0;
33 for (const item of items) {
4removed sum += item.price;
4added sum += item.price * item.quantity;
55 }
6removed return sum;
6added return sum * (1 + taxRate);
77}
88
99export default total;