Get object from response

Hi there,
I have a variable called response, made by a Mongoose query and if I console.log it, it comes out as:
{ projectname: ‘testproject’ },
{ projectname: ‘testprojectnotreal’ }
I need just [‘testproject’, ‘testprojectnotreal’], but if I use console.log(response[‘projectname’]) it comes back as undefined. How do I get it as I want it?

Changing “response” to this will work:
{projectname: [‘testproject’, ‘testprojectnotreal’]}
You don’t need an Array of Objects, but use an Array for the properties of the Object.

Thanks, yep.
Found I need to do this instead:

Ok, but it doesn’t return an Array and return a String, is it a problem? If not, there’s no longer need of discussion about this.

Got it working with this code:
const iterator = response.values();

      for (const value of iterator) {

Surprisingly it works! :slight_smile:
Thanks for the help

bruh you used that way. Anyway don’t forget to mark this as solved :slight_smile: