JSFiddle - React, Tailwind, and code Playground
by Kyle Pennell
HTML
<h1>
Array Literals practice
</h1>
this is Json
<h2 id="box1">
Array Literals
</h2>
<br/>
these are array literals
<h2 id="box2">
Array Literals
</h2>
<h2 id="box3">
Array Literals
</h2>
JavaScript
var shirt= [
{"name":"John","size":"M","color":"Red"}
]
var shirt2 = {
shirt2:{name:"john2",size:"M2",color:"Red2"}
};
var shirt3 = ["John3","M3","Red3"];
var box1 = document.getElementById("box1");
var box2 = document.getElementById("box2");
var box3 = document.getElementById("box3");
box1.innerHTML = shirt[0].name + shirt[0].size;
box2.innerHTML = shirt2.shirt2.name + shirt2.shirt2.size;
box3.innerHTML = shirt3[0];