This commit is contained in:
Karan
2021-11-30 18:40:52 +05:30
parent 8e30dea79c
commit 547a908095
3 changed files with 0 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
// This is a json object, create a file named list.json in this directory and place this object[] in it.
/*[
{
"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}`);
});
})