From 437d658c3a3614eb7548cbc0b587e558766634aa Mon Sep 17 00:00:00 2001 From: Jay Johnston Date: Wed, 14 Jan 2026 11:41:25 -0600 Subject: [PATCH] Adjust reducer so new Todo.id is 4 not 1 --- app.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.ts b/app.ts index be8e0c5..6ed743d 100644 --- a/app.ts +++ b/app.ts @@ -32,7 +32,7 @@ function addTodoItem(todo: string): Todo { } function getNextId(items: T[]): number { - return items.reduce((max, x) => x.id > max ? max : x.id, 0) + 1 + return items.reduce((max, x) => x.id > max ? x.id : max, 0) + 1 } const newTodo = addTodoItem("Buy lots of stuff with all the money we make from the app")