Diff Checker

Compare two text blocks with advanced diff visualization and merge conflict resolution

Added: 3 lines
Removed: 5 lines
Unchanged: 2 lines
Similarity: 28.57%
View:

Options

Upload
Upload
7 lines
1function calculateTotal(items) {
2 let total = 0;
3 for (let i = 0; i < items.length; i++) {
4 total += items[i].price;
5 }
6 return total;
7}
5 lines
1function calculateTotal(items) {
2 return items.reduce((total, item) => {
3 return total + item.price;
4 }, 0);
5}