Skip to content

Instantly share code, notes, and snippets.

@uyu423
Created July 24, 2016 17:22
Show Gist options
  • Save uyu423/1f3348787d04012ff9d6cf080bfd739c to your computer and use it in GitHub Desktop.
Save uyu423/1f3348787d04012ff9d6cf080bfd739c to your computer and use it in GitHub Desktop.
<head>
<title>JSON Basic</title>
<meta charset="utf-8"/>
</head>
<body>
<script>
/* Array and Object Definition */
var arr = [ "Yongwoo", 25, "Catholic Univ, of Korea", "Computer Science" ];
var obj = { "NAME" : "Yongwoo", "AGE" : 25, "UNIVERSITY" : "Catholic Univ, of Korea", "MAJOR" : "Computer Science" };
/* Array and Object Value Check */
document.write("<b>Normal String Arrary :</b> ", arr, "<br/>");
document.write("<br/><b>Normal Object</b><br/>");
for(var objVarName in obj) {
document.write(objVarName, " : ", obj[objVarName], "<br/>");
}
</script>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment