This commit is contained in:
2024-10-25 11:49:35 +02:00
parent b907fa988b
commit 53c3a4d24a
7 changed files with 202 additions and 0 deletions

12
Practice/Json/Index.html Normal file
View File

@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script src="script.js"></script>
</body>
</html>

1
Practice/Json/names.json Normal file
View File

@ -0,0 +1 @@
["Spongebob", "Patrick", "Sandy", "Squidward"]

17
Practice/Json/people.json Normal file
View File

@ -0,0 +1,17 @@
[{
"name": "Spongebob",
"age": 50,
"isemployed": true
}, {
"name": "Patrick",
"age": 32,
"isemployed": true
}, {
"name": "Sandy",
"age": 32,
"isemployed": false
}, {
"name": "Squidward",
"age": 32,
"isemployed": false
}]

10
Practice/Json/person.json Normal file
View File

@ -0,0 +1,10 @@
{
"name": "Spongebob",
"age": 50,
"isemployed": true,
"Hobbies": ["Karate", "Danceing", "Cooking"],
"address": {
"street": "Some st",
"number": 123
}
}

19
Practice/Json/script.js Normal file
View File

@ -0,0 +1,19 @@
const names = ["Spongebob", "Patrick", "Sandy", "Squidward"];
const jsonstrings = JSON.stringify(names);
console.log(names);
console.log(jsonstrings);
const person = {
name: "Spongebob",
age: 50,
isemployed: true,
Hobbies: ["Karate", "Danceing", "Cooking"],
address: {
street: "Some st",
number: 123
}
};
console.log(person);
console.log(JSON.stringify(person));