OOP

Run Settings
LanguageJavaScript
Language Version
Run Command
function Mail() { this.from = "alfian@gmail.com" } Mail.prototype.sendMessage = function n(msg, to) { console.log(`you send: ${msg} to ${to} from ${this.from}`); } // instantiation const mail1 = new Mail(); mail1.sendMessage('Hello', 'nida@gmail.com');
class Mail { cunstructor() { this.from: 'alfian@gmail.com'; } sendMessage(msg,to) { console.log(`you send: ${msg} to ${to} from ${this.from}`); } } const mail1 = new Mail(); Mail.sendMessage('I love you', 'nida rahmalia')
Editor Settings
Theme
Key bindings
Full width
Lines