Config
Table of Contents

Method

Number#limit( min, max )

Limits the number to be within the given range.

Parameters

minNumber The minimum allowed value.
maxNumber The maximum allowed value.

Returns

Number The nearest number to the current value within the allowed range.

"use strict";

Number.implement({
 limit: function ( min, max ) {
   // +0 is required to unbox 'this' back into a primitive number in IE.
   // Otherwise you get a boxed value, which amongst other things makes 0 a
   // truthy value, leading to all sorts of interesting behaviour...
   return this < min ? min : this > max ? max : this + 0;
 },

Method

Number#mod( n )

Returns the number mod n.

Parameters

nNumber

Returns

Number The number mod n.

mod: function ( n ) {
   var m = this % n;
   return m < 0 ? m + n : m;
 }
});
Animation
Application
Core
DataStore
DOM
DragDrop
Foundation
IO
Localisation
Selection
Parser
TimeZones
Storage
Touch
CollectionViews
UA
ContainerViews
ControlViews
PanelViews
View