JSFiddle - React, Tailwind, and code Playground

by Andy Mcloughlin

HTML

<div id="blah"></div>
<p id="blahblah"></p>
<p id="blahblahblah"></p>

JavaScript

var pet = {
    dog: {
        breed: ["Maltese", "Coton", "White_Terrier", "Westie"],
        name: ["Simba", "Coco", "Ben", "Tigger"],
        color: "white",
        description: "They are all white in color, sometimes come with beige on their ears",
        size: ["medium", 0, 1, 2]
    }
};


//var sim = ["simba", "fong"];
//alert(sim.join(""));

//alert(sim[0].toUpperCase() + " " + "size is:" + pet.dog.size[0]);

var dogsDescription = pet.dog.description;
var dogBreeds = pet.dog.breed;

var breeds = function () {
    for (var i in dogBreeds) {
        $("#blah").after(dogBreeds[i] + ", ");
        console.log(dogBreeds[i]);
    }
};

alert("My dog is a " + pet.dog.breed[0] + " " + "and his name is" + " " + pet.dog.name[0]);

breeds();

$("#blahblah").text(dogsDescription);