lib/libs.js
function histogram () {
                    var histogram = {};
                    libs.object.every(arguments, function (o) {
                        if(typeof o === 'boolean') {
                            if(!histogram[o]) histogram[o] = 1; else histogram[o]++;
                        }
                        else if(typeof o === 'function') {
                            if(!histogram['function']) histogram['function'] = 1; else histogram[o]++;
                        }
                        else {
                            libs.object.every(o, function (val) {
                                switch(true) {
                                    case typeof val === 'function':
                                    case typeof val === 'undefined':
                                        val = typeof val;
                                        break;
                                    case typeof val === 'object' && val === null:
                                        val = 'null';
                                        break;
                                    case typeof val === 'object' && val instanceof Array:
                                        val = 'array';
                                        break;
                                    case typeof val === 'object':
                                        val = 'object';
                                        break;
                                    default:
                                        val = val.toString();
                                }

                                if(typeof histogram[val] !== 'number') histogram[val] = 0;
                                histogram[val]++;
                            });
                        }
                    });
                    return histogram;
                }
function histogram () {
                    var histogram = {};
                    libs.object.every(arguments, function (o) {
                        if(typeof o === 'boolean') {
                            if(!histogram[o]) histogram[o] = 1; else histogram[o]++;
                        }
                        else if(typeof o === 'function') {
                            if(!histogram['function']) histogram['function'] = 1; else histogram[o]++;
                        }
                        else {
                            libs.object.every(o, function (val) {
                                switch(true) {
                                    case typeof val === 'function':
                                    case typeof val === 'undefined':
                                        val = typeof val;
                                        break;
                                    case typeof val === 'object' && val === null:
                                        val = 'null';
                                        break;
                                    case typeof val === 'object' && val instanceof Array:
                                        val = 'array';
                                        break;
                                    case typeof val === 'object':
                                        val = 'object';
                                        break;
                                    default:
                                        val = val.toString();
                                }

                                if(typeof histogram[val] !== 'number') histogram[val] = 0;
                                histogram[val]++;
                            });
                        }
                    });
                    return histogram;
                }
function histogram ( ) { var histogram = { } ; libs . object . every ( arguments , function ( o ) { if ( typeof o === 'boolean' ) { if ( ! histogram [ o ] ) histogram [ o ] = 1 ; else histogram [ o ] ++ ; } else if ( typeof o === 'function' ) { if ( ! histogram [ 'function' ] ) histogram [ 'function' ] = 1 ; else histogram [ o ] ++ ; } else { libs . object . every ( o , function ( val ) { switch ( true ) { case typeof val === 'function' : case typeof val === 'undefined' : val = typeof val ; break ; case typeof val === 'object' && val === null : val = 'null' ; break ; case typeof val === 'object' && val instanceof Array : val = 'array' ; break ; case typeof val === 'object' : val = 'object' ; break ; default : val = val . toString ( ) ; } if ( typeof histogram [ val ] !== 'number' ) histogram [ val ] = 0 ; histogram [ val ] ++ ; } ) ; } } ) ; return histogram ; }
Computes the frequencies for each item in all of arguments.
@param {...*} objs The objects to compute the histogram from.
@return {Object<Number>} An object that has the items from all of the arguments as its keys and their frequencies as it's values.
Computes the frequencies for each item in all of arguments .