Tobie Langel a écrit :
>
> Hi Andi,
>
> You can open a ticket for this, but it'll need tests.
>
> I'd favor a more concise notation:
>
> Number.prototype.setInRange = function(from, to) {
> return Math.min(Math.max(from, this), to);
> };
For performance's sake:
Number.prototype.constrain
Hi Andi,
You can open a ticket for this, but it'll need tests.
I'd favor a more concise notation:
Number.prototype.setInRange = function(from, to) {
return Math.min(Math.max(from, this), to);
};
and I'm not really sure bout the use of that method not the api.
For some reason, I think it s