JavaScript classes with getter and setter cause RangeError: Maximum call stack size exceeded

Your “cash” setter calls the “cash” setter, which calls the “cash” setter, which calls the “cash” setter…

Accessing the property setter by its own name inside the setter creates an infinite recursive function call.

Leave a Comment