Home
Run >
class Customer { Name : string; constructor (firstName: string, lastName: string) { this.Name = firstName + " " + lastName; } GetName() { return "Hello, " + this.Name; } } let cust = new Customer("Jimi","Scott"); let button = document.createElement('button'); button.textContent = "Display Full Name"; button.onclick = function() { alert(cust.GetName()); } document.body.appendChild(button);