Text Diff Checker
Compare two texts line by line, unified or side by side.
- Added
- +4
- Removed
- -4
- Unchanged
- 4
| 1 | + | function harvest(errors: SyntaxError[]) { | |
| 2 | + | if (!errors.length) return 0; | |
| 1 | - | function harvest(errors) { | |
| 2 | 3 | let total = 0; | |
| 4 | + | for (const e of errors) { | |
| 5 | + | total += e.weight; | |
| 3 | - | for (var i = 0; i < errors.length; i++) { | |
| 4 | - | total += errors[i].weight; | |
| 5 | 6 | } | |
| 6 | - | // TODO: handle empty input | |
| 7 | 7 | return total; | |
| 8 | 8 | } |
Try next
- Calculators
Scientific Calculator
Expressions with functions, constants, degrees or radians, and history.