Bugs fixed - nickberliner1/check-list-app GitHub Wiki
ES6 conversion
I first converted everything into ES6 modules and classes/objects. It was easier to see individual parts and test them when they weren't just a mess of functions.
Spelling mistake
js/controller.js (line 91)
The first bug was just a spelling error, creating a function named adddItem
but calling addItem
. I changed the function name to addItem
and all was good.
Duplicate IDs
js/store.js (line 74 - 75)
Another one I found was possible duplicating IDs, since they were "randomly" generated by simply choosing a random number from 1-10. I instead defined newId
as a new Date()
.
let newId = new Date();
newId = newId.valueOf();