Set and Get methods in Classes

When I define the following classes on the server I get: RangeError: Maximum call stack size exceeded at at Developer.groups.set (server/classes/ApplicationUser.js:5:1),
at Developer.groups.set (server/classes/ApplicationUser.js:29:9)

ApplicationUser = class ApplicationUser{
    constructor(firstName, lastName, username, password, email, groups){
        this.firstName = firstName;
        this.lastName = lastName;
        this.username = username;
        this.password = password;
        this.email = email;
        this.groups = groups;
    }

    get firstName() {
        return this.firstName;
    }

    set firstName(value) {
        this.firstName = value;
    }

//repeat for all variables
}
Developer = class Developer extends ApplicationUser{
    constructor(firstName, lastName, username, password, email, groups){
        super(firstName, lastName, username, password, email, groups);
    }
}

But. When I remove all the set and get methods from the ApplicationUser class and replace them with:

…setFirstName(value){ this.firstName = value}
…getFirstName{ return this.firstName}
//repeat for all
the application runs without error? Why is this?

I think I figured it out a part of it. Something to do with firstName() and firstName?

Any reason to use get and set here instead of regular methods? I feel like they operate in a pretty odd way and most js developers don’t use them frequently

On face value some examples from Stackoverflow seemed to imply that get someProperty() is simply a new syntactical way to define a get/set method.
However after looking through the doco at MDN I see that the getter syntax actually binds an object property to a function. This ones my bad and makes more sense. Thanks for asking the question, it prompted me to look further into official doco.

Well, your setter

set firstName(value) {
  this.firstName = value;
}

will produce an infinite loop, due to the second line. You assign a value to the very same property name as your setter defines.