Unified Diff Viewer 온라인 도구
브라우저에서 Unified Diff Viewer을(를) 사용할 수 있습니다. 가입은 필요하지 않습니다.
1
Files
1
Hunks
3
Added lines
1
Removed lines
3
Context lines
b/src/app.ts
--- a/src/app.ts · +++ b/src/app.ts
@@ -1,6 +1,8 @@
| 1 | 1 | export function total(items) { | |
| 2 | - | return items.length | |
| 2 | + | return items.reduce((sum, item) => { | |
| 3 | + | return sum + item.count | |
| 4 | + | }, 0) | |
| 3 | 5 | } | |
| 4 | 6 | console.log(total([{ count: 2 }])) |
Unified Diff Viewer 온라인 도구
브라우저에서 Unified Diff Viewer을(를) 사용할 수 있습니다. 가입은 필요하지 않습니다.