Skip to content

Instantly share code, notes, and snippets.

@mohanadkaleia
Created April 13, 2018 03:39
Show Gist options
  • Save mohanadkaleia/df05563693a6f99f1c18b1e4fdd82f11 to your computer and use it in GitHub Desktop.
Save mohanadkaleia/df05563693a6f99f1c18b1e4fdd82f11 to your computer and use it in GitHub Desktop.
class User {
add(name, age) {
this.name = name;
this.age = age;
console.log(`Username: ${this.name} age: ${this.age}`);
}
add(name) {
this.name = name;
console.log(`Username: ${this.name}`);
}
}
let user = new User();
user.add('Mohanad', 29); // Username: Mohanad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment