function filter(array, test){
    let result = [];
   each(array, (element, index, array) =>{
       if(test(element, index, array)){
           result.push(element);
       }
   });
   return result;
}
/**
      * filter: Designed to filter values in a collection based on a test. 
      * Takes a collection, Array or Object, and passes each element, index, and collection 
      * in the collection through a test Function. The test Function returns 
      * true if the value passes the test, false otherwise. Values that pass 
      * the test are collected and returned in an output Array.
      * 
      * @param {Array} array: The collection to filter.
      * @param {Function} test: The Function to be applied to each element, index,
      * and collection in the collection. The test Function must return a Boolean based on some 
      * logic which tests the value given to it.
      * 
      * @return {Array}: An Array containing the filtered collection values. 
      * The Array will contain only the values that passed the test.
      */
Designed to filter values in a collection based on a test.
Takes a collection, Array or Object, and passes each element, index, and collection
in the collection through a test Function. The test Function returns
true if the value passes the test, false otherwise. Values that pass
the test are collected and returned in an output Array.

@param {Array} array: The collection to filter.
@param {Function} test: The Function to be applied to each element, index,
and collection in the collection. The test Function must return a Boolean based on some
logic which tests the value given to it.

@return {Array}: An Array containing the filtered collection values.
The Array will contain only the values that passed the test.
Designed to filter values in a collection based on a test . Takes a collection Array or Object and passes each element index and collection in the collection through a test Function . The test Function returns true if the value passes the test false otherwise . Values that pass the test are collected and returned in an output Array . @param { Array } array : The collection to filter . @param { Function } test : The Function to be applied to each element index and collection in the collection . The test Function must return a Boolean based on some logic which tests the value given to it . @return { Array } : An Array containing the filtered collection values . The Array will contain only the values that passed the test .
function filter(array, test){
    let result = [];
   each(array, (element, index, array) =>{
       if(test(element, index, array)){
           result.push(element);
       }
   });
   return result;
}
function filter ( array , test ) { let result = [ ] ; each ( array , ( element , index , array ) => { if ( test ( element , index , array ) ) { result . push ( element ) ; } } ) ; return result ; }
filter: Designed to filter values in a collection based on a test.
filter : Designed to filter values in a collection based on a test .