-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJS16.html
More file actions
34 lines (31 loc) · 939 Bytes
/
JS16.html
File metadata and controls
34 lines (31 loc) · 939 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>JASON tutorial in javascript</title>
</head>
<body>
<div class="container">
<h1>JASON stands for JAVA SCRIPT OBJECT NOTATION</h1>
<p>The format is used to store and transport data</p>
</div>
<script>
let jsonobj = {
name:'harsh',
channel:'WebFusion',
location:'India',
food:'Bhindi'
}
console.log(jsonobj);
// jason is used to convert all the object strinig in one string using JSON.stringify(obname)
let str = JSON.stringify(jsonobj);
console.log(str);
jsonobj = str.replace('harsh','harry')
console.log(jsonobj);
// reconvert to object
newjson = JSON.parse(jsonobj)
console.log(newjson)
</script>
</body>
</html>