Skip to content

Commit 34f67b4

Browse files
authored
Update index.js
An object has not "FOR EACH" function...Try to test our changes between lines 4 to 12.
1 parent cde2cb9 commit 34f67b4

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

projects/note-app/index.js

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
const btnEl = document.getElementById("btn");
22
const appEl = document.getElementById("app");
33

4-
getNotes().forEach((note) => {
5-
const noteEl = createNoteEl(note.id, note.content);
6-
appEl.insertBefore(noteEl, btnEl);
7-
});
4+
const notas = getNotes();
5+
6+
for (const note in notas) {
7+
if (Object.hasOwnProperty.call(notas, note)) {
8+
const element = notas[note];
9+
const noteEl = createNoteEl(element.id, element.content);
10+
appEl.insertBefore(noteEl, btnEl);
11+
}
12+
}
813

914
function createNoteEl(id, content) {
1015
const element = document.createElement("textarea");

0 commit comments

Comments
 (0)