From 64acf712cd7fd324457ec1ad2e4dda94402846f2 Mon Sep 17 00:00:00 2001 From: Bruno Dulcetti Date: Sat, 6 Oct 2018 19:35:52 -0300 Subject: [PATCH] Add Hello World code example --- code/dulcetti.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 code/dulcetti.js diff --git a/code/dulcetti.js b/code/dulcetti.js new file mode 100644 index 0000000..7f98221 --- /dev/null +++ b/code/dulcetti.js @@ -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();