Skip to content

Instantly share code, notes, and snippets.

@jsoverson
Created August 9, 2019 21:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jsoverson/52d06dd5f37cb8f7ff01d73663025900 to your computer and use it in GitHub Desktop.
Save jsoverson/52d06dd5f37cb8f7ff01d73663025900 to your computer and use it in GitHub Desktop.
(function () {
class c {
constructor(d) {
this.target = d;
}
greet() {
console.log("Hello " + this.target);
}
setTarget(e) {
this.target = e;
}
}
const f = new c("world");
f.greet();
f.setTarget("reader");
f.greet();
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment