How to take a value in an object without properties in jQuery
<p>From Datatables data i need to extrapolate column data for a statistical calculation like Averages (Mean, Median, Mode). The automatic calculation must take place even when the table is filtered. I managed to get the desired values, but I can not extrapolate the trend from an object without property. ex:</p>

<pre><code>sortFilteredDataColumn: 
2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,5,5,5,5,5,5

Average: 3.2857142857142856
Mode  -&gt; Object {2: 9, 3: 13, 4: 7, 5: 6}
</code></pre>

<p>Ok notice that the mode is [3: 13]. So i want take that value and enhance a variable and display it in a convenient way.</p>

<pre><code>    FF f5 
    Object { 2=9,  3=13,  4=7,  other elements...}
</code></pre>

<p>and in DOM ispector:</p>

<pre><code>    object
    2 9
    3 13
    4 7
    5 6
</code></pre>

<p>Desiderable variable: var myMode = objectValueForIndex:1
Any help is largely appreciated.</p>

<p>my code:</p>

<pre><code>        "footerCallback": function ( row, data, start, end, display ) {
     //  console.log('data'+  data.a3 /*JSON.stringify(data)*/);

        var api = this.api(), data;

        // Remove the formatting to get integer data for summation
        var intVal = function ( i ) {
            return typeof i === 'string' ?
                i.replace(/[\$,]/g, '')*1 :
                typeof i === 'number' ?
                    i : 0;
        };

        // Total over all pages
        total = api
            .column( 4 )
            .data()
            .reduce( function (a, b) {
                return intVal(a) + intVal(b);
            }, 0 );

        // Total over this page
        pageTotal = api
            .column( 4, { page: 'current'} )
            .data()
            .reduce( function (a, b) {
                return   intVal(a) +  intVal(b);
            }, 0 );


          // SUM COLUMN 4
          sum = api
            .column( 4, {'search': 'applied'} )
            .data()
            .reduce( function ( a, b ) {
                return intVal(a) +  intVal(b);
            }, 0 );
            console.log('SUM', sum);

            var intVal2 = function ( i ) {
            return typeof i === 'string' ?
                i.replace(/[\$,]/g, '')*1 :
                typeof i === 'number' ?
                    i : 0;
         };

            filteredData = api
            .column( 4, {'search': 'applied'} )
            .data(function ( i, item ) {
            //console.log('filterData',item[ 0 ]);
               return item;              
            });

            var columnStat = new Array();
            $.each(filteredData, function(i, item) {
              //  console.log('DataX ',item);
                columnStat.push(item);
            });
            console.log('columnStat.count: '+columnStat.length);
            console.log('filteredDataX', columnStat);

          function compareNumbers2(a, b)
          {
              return a - b;
          }

          columnStat.sort(compareNumbers2);
          console.log('sortFilterDataX: '+columnStat);
          console.log('Media: '+ sum / columnStat.length);

          var obj2 = { };
          for (var i = 0, j = columnStat.length; i &lt; j; i++) {
             obj2[columnStat[i]] = (obj2[columnStat[i]] || 0) + 1;
          }
          console.log(obj2);

          // Try to Get Value From Object
          var array = $.map(obj2, function(value, index) {
          return [value];
          });
          console.log(array);
</code></pre>

<p>output [9, 13, 7, 6]</p>

<pre><code>          // Try to Get key From Object
          var array2 = $.map(obj2, function(key, index) {
          return [index];
          });
          console.log(array2);            
</code></pre>

<p>output ["2", "3", "4", "5"]</p>

<pre><code>          console.log('BREAK LOG');   

        // Update footer
        $( api.column( 4 ).footer() ).html(
            'M2 '+pageTotal  /end +' ('+ total +' totali)'
        );
    }
</code></pre>