Skip to content

Bug Fixing

Roheem Olayemi edited this page Jan 30, 2020 · 4 revisions

The following are the list of bugs that were fixed:

controller.js

found a typo on line 95

Controller.prototype.adddItem

changed it to

Controller.prototype.addItem

index.html

found omission of the id attribute on line 16

<input class="toggle-all" type="checkbox">

added into it

<input class="toggle-all" id="toggle-all" type="checkbox"> This is as a result of attributing or connecting the input element with a corresponding label element that has a 'for' attribute.

<label for="toggle-all">Mark all as complete</label>

So the value of the 'id' attribute within the input element should correspond to the respective label element

store.js

found on line 83

for (var i = 0; i < 6; i++) { newId += charset.charAt(Math.floor(Math.random() * charset.length)); }

replaced with

var isDuplicate = true;

while (isDuplicate){ for (var i = 0; i < 6; i++) { newId += charset.charAt(Math.floor(Math.random() * charset.length)); } isDuplicate = false; for (var i = 0; i < todos.length; i++) { if (todos[i].id == newId) { isDuplicate = true; } } }

Clone this wiki locally