APIs
This commit is contained in:
12
Practice/Json/Index.html
Normal file
12
Practice/Json/Index.html
Normal 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
1
Practice/Json/names.json
Normal file
@ -0,0 +1 @@
|
||||
["Spongebob", "Patrick", "Sandy", "Squidward"]
|
17
Practice/Json/people.json
Normal file
17
Practice/Json/people.json
Normal 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
10
Practice/Json/person.json
Normal 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
19
Practice/Json/script.js
Normal 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));
|
Reference in New Issue
Block a user