Skip to content

Instantly share code, notes, and snippets.

@Oluwasetemi
Last active May 30, 2020 12:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Oluwasetemi/c6264a1a24930b03266833e96b59a9ec to your computer and use it in GitHub Desktop.
Save Oluwasetemi/c6264a1a24930b03266833e96b59a9ec to your computer and use it in GitHub Desktop.
Update the Hello World JS
// 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();

Run node hello_world.js to print Hello Ade!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment