0

I am storing messages inside my msges field. This is the format

enter image description here

I called ajax and it is returning me the data in this format

[ object, object, object ]

I want to convert it into an array with object keys and object values. How can I do that?

Ali Zia
  • 3,825
  • 5
  • 29
  • 77

1 Answers1

0

You have read values as object

//result is the result of the query
    for (var line in result) {
    //acces to uname by line.uname
    //acces to email by line.email
    }

Hope that will help you

Or you can use for each

//result is the result of the query
        for each(line in result) {
        //acces to uname by line.uname
        //acces to email by line.email
        }
G. Mansour
  • 696
  • 6
  • 15