JSFiddle - React, Tailwind, and code Playground

HTML

<p>Click the button to create an array, then display it's length.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
    function myFunction() {
        var fruits = ["Banana", "Orange", "Apple", "Mango"];
        document.getElementById("demo").innerHTML = fruits.length;
    }
</script>