I've been studying JavaScript a few days ago and realized that in object orientation, it seems to contain a number of ways to create objects and methods. Examples:
class Person {
constructor (firstName) {
this.firstName= firstName
}
or
const Person = function(firstName) {
this.firstname = firstName
}
Person.prototype.setName() {
}
What's the difference? Is there any more way used?