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")