Harjutus 2
import "./styles.css";
const myjson = [
{
Car: {
Color: "Rose red",
"Tinted windows": false,
Wheels: 4,
"Roof cargo": null,
Entertainment:
"FM Radio, MP3, MP4 and MKV player, harman/kardon speakers",
Accessories: "satnav, cruise control",
},
},
{
Car: {
Color: "Navy blue",
"Tinted windows": true,
Wheels: 4,
"Roof cargo": "Thule",
Entertainment:
"FM Radio, Apple CarPlay/Android Auto, Bowers & Wilkins Premium Sound speakers",
Accessories: "self drive system, luggage cover",
},
},
];
document.getElementById("app").innerHTML = `
<div id="json">
<h1>Car properties</h1>
<h2>Car 0</h2>
<p>Color: ${myjson[0].Car.Color}</p>
<p>Tinted windows: ${myjson[0].Car["Tinted windows"] ? "TRUE" : "FALSE"}</p>
<p>Wheels: ${myjson[0].Car.Wheels}</p>
<p>Roof cargo: ${
myjson[0].Car["Roof cargo"] ? myjson[0].Car["Roof cargo"] : "None"
}</p>
<p>Entertainment: ${myjson[0].Car.Entertainment}</p>
<p>Accessories: ${myjson[0].Car.Accessories}</p>
<h2>Car 1</h2>
<p>Color: ${myjson[1].Car.Color}</p>
<p>Tinted windows: ${myjson[1].Car["Tinted windows"] ? "TRUE" : "FALSE"}</p>
<p>Wheels: ${myjson[1].Car.Wheels}</p>
<p>Roof cargo: ${
myjson[1].Car["Roof cargo"] ? myjson[1].Car["Roof cargo"] : "None"
}</p>
<p>Entertainment: ${myjson[1].Car.Entertainment}</p>
<p>Accessories: ${myjson[1].Car.Accessories}</p>
</div>
`;

auto andmeidHarjutus 3
nuppude lisamine
Session Storage’isse salvestatudHarjutus 4
nuppude lisamine
Session Storage’isse salvestatudHarjutus 5
