diff --git a/exercises/57 - Shopping List/shopping-FINISHED.js b/exercises/57 - Shopping List/shopping-FINISHED.js index 399ea3744..aed3c0382 100644 --- a/exercises/57 - Shopping List/shopping-FINISHED.js +++ b/exercises/57 - Shopping List/shopping-FINISHED.js @@ -31,15 +31,17 @@ function displayItems() { .map( item => `
  • + name="item-${item.id}" + ${item.complete ? 'checked' : ''} + /> ${item.name}
  • ` ) .join(''); @@ -54,18 +56,15 @@ function mirrorToLocalStorage() { function restoreFromLocalStorage() { console.info('Restoring from LS'); // pull the items from LS - const lsItems = JSON.parse(localStorage.getItem('items')); + const lsItems = JSON.parse(localStorage.getItem('items')) || []; if (lsItems.length) { - // items = lsItems; - // lsItems.forEach(item => items.push(item)); - // items.push(lsItems[0], lsItems[1]); - items.push(...lsItems); + items = lsItems; list.dispatchEvent(new CustomEvent('itemsUpdated')); } } function deleteItem(id) { - console.log('DELETIENG ITEM', id); + console.log('DELETING ITEM', id); // update our items array without this one items = items.filter(item => item.id !== id); console.log(items); diff --git a/exercises/76 - Dad Jokes/index-FINISHED.html b/exercises/76 - Dad Jokes/index-FINISHED.html index fac01a717..43ec27d33 100644 --- a/exercises/76 - Dad Jokes/index-FINISHED.html +++ b/exercises/76 - Dad Jokes/index-FINISHED.html @@ -78,7 +78,7 @@ - + diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 000000000..c94ab2edd --- /dev/null +++ b/package-lock.json @@ -0,0 +1,13 @@ +{ + "name": "beginner-javascript", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "beginner-javascript", + "version": "1.0.0", + "license": "ISC" + } + } +}