mirror of
https://github.com/c0de-archive/hacktoberfest-2018.git
synced 2024-12-22 05:12:40 +00:00
Add Hello World code example
This commit is contained in:
parent
0f9e5e6dbf
commit
64acf712cd
18
code/dulcetti.js
Normal file
18
code/dulcetti.js
Normal file
@ -0,0 +1,18 @@
|
||||
class Beer {
|
||||
constructor(name = 'Dulcetti', beerName = 'Karmeliet') {
|
||||
this.name = name;
|
||||
this.beerName = beerName;
|
||||
}
|
||||
|
||||
sayHello() {
|
||||
console.info(`Hello, ${ this.name }. Do you wanna a ${ this.beerName }?`)
|
||||
}
|
||||
}
|
||||
|
||||
// Hello with modified infos
|
||||
const myInfos = new Beer('Bruno', 'Duvel');
|
||||
myInfos.sayHello();
|
||||
|
||||
// Hello with default infos
|
||||
const defaultBeer = new Beer();
|
||||
defaultBeer.sayHello();
|
Loading…
Reference in New Issue
Block a user