JSFiddle - React, Tailwind, and code Playground
JavaScript
var Foo = function( a )
{
var myName = {
first: a,
last: ''
};
this.doStuff = function( b )
{
myName.last = b;
return myName;
};
}
var foo = new Foo('john');
console.log( foo.doStuff('smith') );