JSFiddle - React, Tailwind, and code Playground
JavaScript
function person(firstName, lastName, age, eyeColor) {
this.firstName = firstName;
this.lastName = lastName;
this.fullName = function() {
return this.firstName + " " + this.lastName
}
}
var p = new person('Foo', 'Bar');
// check the console
console.log("fullname is " + p.fullName());