Skip to content

Commit d771cd0

Browse files
committed
save localStorage with JSON
1 parent bb9ca38 commit d771cd0

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

15 - LocalStorage/index-START-y.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ <h2>LOCAL TAPAS</h2>
4242
items.push(item); //add item
4343
// console.table(items); //check
4444
populateList(items, itemsList);
45+
// only string
46+
localStorage.setItem('items', JSON.stringify(items));
4547
this.reset(); //clear item
4648
}
4749

0 commit comments

Comments
 (0)