Ember.EnumerableUtils Class
Defines some convenience methods for working with Enumerables.
Ember.EnumerableUtils uses Ember.ArrayPolyfills when necessary.
Item Index
Methods
addObject
        - 
                        
array - 
                        
item 
Adds an object to an array. If the array already includes the object this method has no effect.
Parameters:
- 
                        
arrayArrayThe array the passed item should be added to
 - 
                        
itemObjectThe item to add to the passed array
 
Returns:
'undefined'
filter
        - 
                        
obj - 
                        
callback - 
                        
thisArg 
Calls the filter function on the passed object with a specified callback. This
uses Ember.ArrayPolyfill's-filter method when necessary.
Parameters:
- 
                        
objObjectThe object to call filter on
 - 
                        
callbackFunctionThe callback to execute
 - 
                        
thisArgObjectValue to use as this when executing callback
 
Returns:
An array containing the filtered values
forEach
        - 
                        
obj - 
                        
callback - 
                        
thisArg 
Calls the forEach function on the passed object with a specified callback. This
uses Ember.ArrayPolyfill's-forEach method when necessary.
Parameters:
- 
                        
objObjectThe object to call forEach on
 - 
                        
callbackFunctionThe callback to execute
 - 
                        
thisArgObjectValue to use as this when executing callback
 
indexesOf
        - 
                        
obj - 
                        
elements 
Returns an array of indexes of the first occurrences of the passed elements on the passed object.
 var array = [1, 2, 3, 4, 5];
 Ember.EnumerableUtils.indexesOf(array, [2, 5]); // [1, 4]
 var fubar = "Fubarr";
 Ember.EnumerableUtils.indexesOf(fubar, ['b', 'r']); // [2, 4]
    Parameters:
- 
                        
objObjectThe object to check for element indexes
 - 
                        
elementsArrayThe elements to search for on obj
 
Returns:
An array of indexes.
indexOf
        - 
                        
obj - 
                        
callback - 
                        
index 
Calls the indexOf function on the passed object with a specified callback. This
uses Ember.ArrayPolyfill's-indexOf method when necessary.
Parameters:
- 
                        
objObjectThe object to call indexOn on
 - 
                        
callbackFunctionThe callback to execute
 - 
                        
indexObjectThe index to start searching from
 
intersection
        - 
                        
array1 - 
                        
array2 
Calculates the intersection of two arrays. This method returns a new array filled with the records that the two passed arrays share with each other. If there is no intersection, an empty array will be returned.
var array1 = [1, 2, 3, 4, 5];
var array2 = [1, 3, 5, 6, 7];
Ember.EnumerableUtils.intersection(array1, array2); // [1, 3, 5]
var array1 = [1, 2, 3];
var array2 = [4, 5, 6];
Ember.EnumerableUtils.intersection(array1, array2); // []
    Parameters:
- 
                        
array1ArrayThe first array
 - 
                        
array2ArrayThe second array
 
Returns:
The intersection of the two passed arrays.
map
        - 
                        
obj - 
                        
callback - 
                        
thisArg 
Calls the map function on the passed object with a specified callback. This
uses Ember.ArrayPolyfill's-map method when necessary.
Parameters:
- 
                        
objObjectThe object that should be mapped
 - 
                        
callbackFunctionThe callback to execute
 - 
                        
thisArgObjectValue to use as this when executing callback
 
Returns:
An array of mapped values.
removeObject
        - 
                        
array - 
                        
item 
Removes an object from an array. If the array does not contain the passed object this method has no effect.
Parameters:
- 
                        
arrayArrayThe array to remove the item from.
 - 
                        
itemObjectThe item to remove from the passed array.
 
Returns:
'undefined'
replace
        - 
                        
array - 
                        
idx - 
                        
amt - 
                        
objects 
Replaces objects in an array with the passed objects.
  var array = [1,2,3];
  Ember.EnumerableUtils.replace(array, 1, 2, [4, 5]); // [1, 4, 5]
  var array = [1,2,3];
  Ember.EnumerableUtils.replace(array, 1, 1, [4, 5]); // [1, 4, 5, 3]
  var array = [1,2,3];
  Ember.EnumerableUtils.replace(array, 10, 1, [4, 5]); // [1, 2, 3, 4, 5]
    Parameters:
- 
                        
arrayArrayThe array the objects should be inserted into.
 - 
                        
idxNumberStarting index in the array to replace. If idx >= length, then append to the end of the array.
 - 
                        
amtNumberNumber of elements that should be removed from the array, starting at idx
 - 
                        
objectsArrayAn array of zero or more objects that should be inserted into the array at idx
 
Returns:
The modified array.
