Skip to content

Instantly share code, notes, and snippets.

@maciejlew
Created March 24, 2016 18:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maciejlew/b9e745708bff98539826 to your computer and use it in GitHub Desktop.
Save maciejlew/b9e745708bff98539826 to your computer and use it in GitHub Desktop.
function Dose() {
var _min = null;
var _max = null;
this.setMin = function(min) {
_min = min;
};
this.setMax = function(max) {
_max = max;
};
this.getMin = function() {
return _min;
};
this.getMax = function() {
return _max;
};
}
Dose.prototype = new Dose();
drug_dose.setMin(1); // OK
drug_dose.setMax('string'); // OK, but does not make sense
drug_dose._min = 1; // OK
drug_dose._max = 'string'; // OK, but does not make sense
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment