JSON stringify ES6 class property with getter/setter
问题 I have a JavaScript ES6 class that has a property set with set and accessed with get functions. It is also a constructor parameter so the class can be instantiated with said property. class MyClass { constructor(property) { this.property = property } set property(prop) { // Some validation etc. this._property = prop } get property() { return this._property } } I use _property to escape the JS gotcha of using get/set that results in an infinite loop if I set directly to property . Now I need