Question: I very new to programming and I can't find the solution of my issue, can you give me the solution please?

I have this JSON file:

```
{
  "groups": "[{ id: 1, title: 'group 1' }, { id: 2, title: 'group 2' }]"
}

```

And I need something like this in my js (but i want import my JSON to get array like this) :

```
const groups = [{ id: 1, title: 'group 1' }, { id: 2, title: 'group 2' }]

```

I don't know how to do without using jQuery.

I already tried with this:

```
const json = require('./test.json');

```

This code returns an object: ![screen of what is returned](https://i.stack.imgur.com/ZBgT3.png)

It's almost what I want but it didn't work when I use it in my code because I don't want an object but and array like I said above.

How can achieve this?

Answer: 
Since I didn't notice the "without jQuery" in the original question, here is a new answer:

```
var request = new XMLHttpRequest();
request.open('GET', './test.json', true);

request.onload = function() {
  if (request.status >= 200 && request.status < 400) {
    // Success!
    var data = JSON.parse(request.responseText);
  } else {
    // We reached our target server, but it returned an error

  }
};

```

It does two things:
 1. Loads the json file
 2. Parses the loaded string into a javascript object.
You can parse the object to an array this way:

`Object.values(YOUR_OBJECT)`

docs: <https://developer.mozilla.org/es/docs/Web/JavaScript/Referencia/Objetos_globales/Object/values>