simulate oop

Run Settings
LanguageJavaScript
Language Version
Run Command
function newPerson(name, age) { const _name = name const _age = age return { age() { return _age }, name() { return _name } } } const p1 = newPerson("max", 13) console.log(`${p1.name()} is ${p1.age()} years old`)
Editor Settings
Theme
Key bindings
Full width
Lines