node.js - Node js read a value from json array -


async.series([ function(callback){             geen.api('openorders', function(error, data) {             callback(null, data.result['open']);             if(error) {             console.log(error);              }               });             }    ], function(err, results){     console.log(results[0]['ojvbce-kz7sx-snnaap'].status) // undefined   }); }); 

returns json:

    [{ 'ojvbce-kz7sx-snnaap':              {  refid: null,                 userred: null,                 status: 'open',                 opentm: 1397461378.8155              }     }] 

how acces this? example: results['ojvbce-kz7sx-snnaap'].status undefined.

it's array , ojvbce-kz7sx-snnaap @ first position so:
results[0]['ojvbce-kz7sx-snnaap'].status

if access way show have have array formed this:

var results = [];   results['ojvbce-kz7sx-snnaap'] = {       refid: null,       userred: null,       status: 'open',       pentm: 1397461378.8155   } 

now results['ojvbce-kz7sx-snnaap'].status work


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -