Skip to content

Instantly share code, notes, and snippets.

@debugmodedotnet
Created March 9, 2017 08:34
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save debugmodedotnet/62352900fe447721e6597956861384fe to your computer and use it in GitHub Desktop.
function printstudent() {
var s1 = new Student("foo", 7);
console.log(s1.name);
}
printstudent(); // Student is not defined error
class Student {
constructor(name, age) {
this.name = name;
this.age = age;
}
}
printstudent(); // print foo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment