class Person {
constructor(name, age, email, location) {
this.name = name;
this.age = age;
this.email = email,
this.location = location,
this.hobbies = []
}
getInfo() {
return { information: { ...this } }
}
setHobbies(hobbies) {
this.hobbies = hobbies
}
}
const person = new Person("Ricardo aka Afterjs", 21, "[email protected]", "Viana do Castelo, Portugal")
person.setHobbies(["Programming", "Listening to music", "Watch Movies"])
info = person.getInfo()
console.log(info)
💻
Eat->Code->Debug->Sleep
Computer engineering degree student on Institute polytechnique of Cávado and Ave.
-
Localhost
- Portugal
- www.ricardoamaro.dev
- @ricardoxma
Highlights
Pinned Loading
Something went wrong, please refresh the page to try again.
If the problem persists, check the GitHub status page or contact support.
If the problem persists, check the GitHub status page or contact support.