Define a property for a JavaScript object
<p>Is such declaration of getter and setter for a property correct and most efficient?</p>

<pre><code>var AxisRange = (function(){
    function AxisRange(){
        this._userMaxValue = 0.0;

        Object.defineProperty(AxisRange.prototype, "UserMaxValue", {
            get : function(){
                return this._userMaxValue;
            },
            set  : function(value){
                if(value != this._userMaxValue){
                    this._userMaxValue = value;
                    this.validateUserMaxValue();
                    this.validateUserStep();

                    this.synchronizeActualRange();
                }
            }
        });
    }

    AxisRange.prototype.validateUserMaxValue = function(){
        alert("validateUserMaxValue");
    };

    return AxisRange;
})();
</code></pre>

<p>Also, I'm using JetBrains WebStorm to write my JS code, and it warns me that </p>

<ol>
<li><code>AxisRange.prototype</code>  used in <code>Object.defineProperty</code> is not assignable to parameter  type Object. </li>
<li>in line <code>if(value != this._userMaxValue)</code> is says "Possible invalid usage of this." </li>
</ol>

<p>Before I go any further with code typing I need to make sure what I'm using is correct.</p>
