From 1b7f0e86ddfc29c526d3f85f852128852afe3768 Mon Sep 17 00:00:00 2001 From: Karan <50290386+Sonawane-Karan26@users.noreply.github.com> Date: Wed, 24 Nov 2021 21:35:04 +0530 Subject: [PATCH] Exercise 15.1 --- Chapter 15/Exercise 15.1 | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Chapter 15/Exercise 15.1 diff --git a/Chapter 15/Exercise 15.1 b/Chapter 15/Exercise 15.1 new file mode 100644 index 0000000..4b16f2e --- /dev/null +++ b/Chapter 15/Exercise 15.1 @@ -0,0 +1,18 @@ +[ + { + "name": "Learn JavaScript", + "status" : true + }, + { + "name": "Try JSON", + "status" : false + } +] + +const url = "list.json"; +fetch(url).then(rep => rep.json()) +.then((data) => { + data.forEach((el) => { + console.log(`${el.name} = ${el.status}`); + }); +})