How do you create an object of a class and call a method from it? I've done this in Java and other languages, but I'm looking to learn the syntax in javascript.
For example I'm looking for something like this:
file1.js
var person = new Person("Joe");
person.getName();
Person.js
function Person() {
this.name = name;
}
function getName(String name) {
return name;
}
Thanks for any help in advance!