class Surgeon { constructor(name, department) { this.name = name; this.department = department; } } const surgeonRomero = new Surgeon('Francisco Romero','Cardiovascular'); // Create new surgeon instance console.log(surgeonRomero.name); const surgeonJackson = new Surgeon('Ruth Jackson','Orthopedics'); // Create new surgeon instance console.log(surgeonJackson.name);
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter