Created
March 9, 2017 08:34
Star
You must be signed in to star a gist
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 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