Help with toggling a single item in a todo list

Help with toggling a single item in a todo list
0

#1

I am working my way through watch and code javascript course. I am running into trouble trying to get a toggle function to work correctly.

When I run the code with debugger position is defined as NaN and the variable todo is undefined. Funny enough the toggle all function I have works without issue. I am thinking maybe I made a spelling or formatting mistake somewhere but I’ve been staring at it so long it is starting to blur together.

Here is a link to paste bin

https://pastebin.com/eNXWq0Wa

Any help would be greatly appreciated!


#2

Check your changeTodo and toggleCompleted functions. There you’re passing a changeTodoPositionInput variable when calling the function that gives you an error, because that variable is not a number. Fix that.

I’m assuming that .valueAsNumber method which you’re using on the mentioned variable isn’t doing its job.