examples/node/results.js
function(results) {
        var rows = [];
        var cols = results.columns;
        
        var mapFirst = function(col) { return col.shift(); };
        
        while(cols.length > 0 && cols[0].length > 0) {
            rows.push(cols.map(mapFirst));   
        }
        
        results.rows = rows;
        return results;
    }
function(results) {
        var rows = [];
        var cols = results.columns;
        
        var mapFirst = function(col) { return col.shift(); };
        
        while(cols.length > 0 && cols[0].length > 0) {
            rows.push(cols.map(mapFirst));   
        }
        
        results.rows = rows;
        return results;
    }
function ( results ) { var rows = [ ] ; var cols = results . columns ; var mapFirst = function ( col ) { return col . shift ( ) ; } ; while ( cols . length > 0 && cols [ 0 ] . length > 0 ) { rows . push ( cols . map ( mapFirst ) ) ; } results . rows = rows ; return results ; }
Instead of trying to print the column-major format, we just transpose it
Instead of trying to print the column - major format we just transpose it