JSFiddle - React, Tailwind, and code Playground

by Charlie Winfrey

JavaScript

var me = (function() {
    
    var trophies = ["Gold", "Silver"];
    
    return {          
        name: "ryan",
        height: 6.3,
        speak: function(words) {   
            console.log(this.name + " says: " + words);
        },
        showTrophy: function(i) {
             console.log(trophies[i]);   
        }
       
    };
    
}());

console.log(me.name);
me.speak("Hello!");