Last active
April 2, 2020 15:48
-
-
Save emrekasg/859ddbed18a4cbb729db6d16318364d7 to your computer and use it in GitHub Desktop.
Sample class for Medium
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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