Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript How to parse array

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #208735
    salll
    Participant

    i have array
    var g = [[{“id”:1,”name”:”salll brown”,”number”:”+99999999\r\n”}]];

    need result g.name its returned undefined

    can anyone help me?

    __
    i found solution
    g[0][0].name

    but i think its bed solution.

    connection.connect();
    
    var usersRows = [];
    connection.query('SELECT * from users', function(err, rows, fields) {
     if (!err) {
        usersRows.push(rows);
       }
        else  {
         console.log(err);
       }
    });
    connection.end();
    

    Is different way to push array like this
    g = {“id”:1,”name”:”salll brown”,”number”:”+99999999\r\n”};

Viewing 1 post (of 1 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.