From 22d917a42b5a08ab062781e77bbdb0b19e0f6be3 Mon Sep 17 00:00:00 2001 From: Karan <50290386+Sonawane-Karan26@users.noreply.github.com> Date: Wed, 24 Nov 2021 21:35:39 +0530 Subject: [PATCH] Project 1 --- Chapter 15/Project 1 | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Chapter 15/Project 1 diff --git a/Chapter 15/Project 1 b/Chapter 15/Project 1 new file mode 100644 index 0000000..8f44f53 --- /dev/null +++ b/Chapter 15/Project 1 @@ -0,0 +1,38 @@ + + + Project 14 + + + + + +// myscript.js +let url = "people.json"; +fetch(url) +.then(response => response.json()) +.then(data => { + console.log(data); + data.forEach(person => { + console.log(`${person.first} ${person.last} - ${person.topic}`); + }); +}); + + +// people.json +[ + { + "first": "Laurence", + "last": "Svekis", + "topic": "JavaScript" + }, + { + "first": "John", + "last": "Smith", + "topic": "HTML" + }, + { + "first": "Jane", + "last": "Doe", + "topic": "CSS" + } +]