JSON Examples in JavaScript

Definition : It is a representation which will be used for holding the data in array and object format. Program 1 : <html>    <head>       <script language=”javascript”>                      function display()                                  {                                  a='[{“name”:”arif”,”age”:24},{“name”:”ranga”,”age”:30}]’;                                  b=JSON.parse(a);                                  for(i=0;i<b.length;i++)                                  document.write(b[i].name+” “+b[i].age+”</br>”);                                  }                   </script>                 </head> …