Run node hello_world.js
to print Hello Ade!
Last active
May 30, 2020 12:34
-
-
Save Oluwasetemi/c6264a1a24930b03266833e96b59a9ec to your computer and use it in GitHub Desktop.
Update the Hello World JS
This file contains 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
// function HelloWorld(name) { | |
// // const this = {}; | |
// this.name = name; | |
// // return this | |
// } | |
class HelloWorld { | |
constructor(name) { | |
this.name = name.toUpperCase(); | |
} | |
sayHi() { | |
console.log(`Hello ${this.name}!`) | |
}; | |
} | |
const hello = new HelloWorld('ade'); | |
hello.sayHi(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment