class Box { constructor (width, length, height, weight) { this._width = width; this._length = length; this._height = height; this._weight = weight; } get width () { return this._width; } set width (width) { this._width = width; } get length () { return this._length; } set length(length) { this._length = length; } get height () { return this._height; } set height(height) { this._height = height; } get volume() { return this.width * this.length * this.height; } } var shoeBox = new Box(20, 35, 15, 0.2); console.log('current volume: '+shoeBox.volume); shoeBox.lenth = 15; shoeBox.width = shoeBox.height * 0.5; console.log('new volume: '+shoeBox.volume); console.log(shoeBox);