function Person(name) { this.name = name; this.introduceSelf = function() { console.log(`Hi! I'm ${this.name}.`); } } const salva = new Person('Salva'); salva.name; salva.introduceSelf(); const frankie = new Person('Frankie'); frankie.name; frankie.introduceSelf();
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