From de3b61c9497412e0e421a966aa0ba392c945d22a Mon Sep 17 00:00:00 2001 From: darrianwesley <81720043+darrianwesley@users.noreply.github.com> Date: Fri, 30 Apr 2021 13:55:56 -0500 Subject: [PATCH 1/5] Update index.html --- index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 8046f00..eabd27a 100644 --- a/index.html +++ b/index.html @@ -10,7 +10,7 @@

Note Taker App


- + @@ -20,7 +20,7 @@

Note Taker App

From 0b6aa9a6d0d344437366d01f065668a96740ae9c Mon Sep 17 00:00:00 2001 From: darrianwesley <81720043+darrianwesley@users.noreply.github.com> Date: Mon, 24 May 2021 16:25:33 -0500 Subject: [PATCH 2/5] Update index.html --- index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index eabd27a..5c8a3d4 100644 --- a/index.html +++ b/index.html @@ -1,5 +1,4 @@ - @@ -10,17 +9,18 @@

Note Taker App


+ - From 69ca5e63689eb94ad2bfac8146c24f68a57d0189 Mon Sep 17 00:00:00 2001 From: darrianwesley <81720043+darrianwesley@users.noreply.github.com> Date: Thu, 3 Jun 2021 07:53:23 -0500 Subject: [PATCH 3/5] Update index.html --- index.html | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 5c8a3d4..4d00af8 100644 --- a/index.html +++ b/index.html @@ -1,4 +1,5 @@ + @@ -10,17 +11,28 @@

Note Taker App


- + From 56d6335d6ae8a2ca62b977c178303df71ad90ee7 Mon Sep 17 00:00:00 2001 From: darrianwesley <81720043+darrianwesley@users.noreply.github.com> Date: Thu, 3 Jun 2021 07:56:18 -0500 Subject: [PATCH 4/5] Update index.js --- index.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/index.js b/index.js index e69de29..5afd5af 100644 --- a/index.js +++ b/index.js @@ -0,0 +1,19 @@ +function getNoteId() { + let noteObject = getExistingNotes() + if(!noteObject){ + return 1 + } + + const keysArray = Object.keys(noteObject); + const numberKeys = keysArray.map((key) => Number(key)) + console.log(numberKeys); + return Math.max( ... numberKeys) + 1; +} + +function getExistingNotes() { + let notes = localStorage.getItem('notes') + if(!notes){ + return null + } + return JSON.parse(notes); +} From 0da2eba59430c23f3b7b3a8a0979300c3c13129f Mon Sep 17 00:00:00 2001 From: darrianwesley <81720043+darrianwesley@users.noreply.github.com> Date: Thu, 3 Jun 2021 07:57:09 -0500 Subject: [PATCH 5/5] Update index2.html --- index2.html | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/index2.html b/index2.html index b4394a5..16c3820 100644 --- a/index2.html +++ b/index2.html @@ -15,6 +15,17 @@ \ No newline at end of file + ( + function getNotes(){ + let notes = getExistingNotes(); + let notesArray = Object.values(notes); + let orderedList = document.getElementById('notes-list') + notesArray.forEach(note => { + let listItem = document.createElement('li') + listItem.innerHTML = note + orderedList.appendChild(listItem) + + }) + })() + +