JSFiddle - React, Tailwind, and code Playground

HTML

<form>
<input type="button" value="Click me!" onclick="window.displaymessage()" />
</form>

<p>By pressing the button above, a function will be called. The function will alert a message.</p>

JavaScript

window.displaymessage= function ()
{    
    var people = {"Anna": 67, "Beto": 8, "Jack": 33, "Sam": 25}
      
    
    for ( person in people ) {
       alert( person + " is " + people[person] + " years old.")
    }
    
    alert(people)
    alert(JSON.stringify(people))
    
   
    
}