Skip to content

Instantly share code, notes, and snippets.

@emrekasg
Last active April 2, 2020 15:48
Show Gist options
  • Save emrekasg/859ddbed18a4cbb729db6d16318364d7 to your computer and use it in GitHub Desktop.
Save emrekasg/859ddbed18a4cbb729db6d16318364d7 to your computer and use it in GitHub Desktop.
Sample class for Medium
class Browser{
constructor(color) {
this.name = 'Medium';
this.color = color;
}
sayName() {
console.log('Hi, This site is '+ this.name+ '.');
}
sayColor() {
console.log('Colors of '+this.name + ' are'+ this.color);
}
}
// If you want to use Browser class
// Reaching the variable in the class.
console.log(browser.color)
// Reaching the function in the class
browser.sayName()
browser.sayColor()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment