JSFiddle - React, Tailwind, and code Playground

JavaScript

function cat() {
 
    
    this.getMyID = function() { alert(this.id); } ;
    
}

var bob = new cat();

// I want it to say 'bob'
bob.getMyID();