Question: My javascript array is :

```
 [
            "Action=Complete",
            "Echo=echotest",
            "PayerID=1675506249460924",
            "ObfuscatedAccountNumber=*********************",
            "ExpireDate=1225",
            "CardholderName=John Q. Test",
            "Address1=123 A. Street",
            "Address2=",
            "Address3=",
            "City=Orem",
            "State=UT",
            "PostalCode=84058",
            "Country=USA",
            "PaymentMethodId=630337dc-3537-4db1-bfaf-be98e838b3a5"
        ]

```

I want to convert it to 

```
{
        "Action":"Complete",
        "Echo":"echotest",
        "PayerID":"1675506249460924",
        "ObfuscatedAccountNumber":"***************",
        "ExpireDate":"1225",
        "CardholderName":"John Q. Test",
        "Address1":"123 A. Street",
        "Address2":,
        "Address3":,
        "City":"Orem",
        "State":"UT",
        "PostalCode":"84058",
        "Country":"USA",
        "PaymentMethodId":"630337dc-3537-4db1-bfaf-be98e838b3a5"
    }

```

is there any way I can achieve that?

Answer: 
This is a hacky solution of mine.

```
var array = [
    "Action=Complete",
    "Echo=echotest",
    "PayerID=1675506249460924",
    "ObfuscatedAccountNumber=*********************",
    "ExpireDate=1225",
    "CardholderName=John Q. Test",
    "Address1=123 A. Street",
    "Address2=",
    "Address3=",
    "City=Orem",
    "State=UT",
    "PostalCode=84058",
    "Country=USA",
    "PaymentMethodId=630337dc-3537-4db1-bfaf-be98e838b3a5"
]

// In ES5
// Declare an empty object.
var obj = {};
array.forEach(function (str) {
   var data = str.split("=");
   obj[data[0]] = data[1];
});

OR

// In ES6
// Declare an empty object.
var obj = {}
array.forEach(str => {
    [key, value] = str.split("=")
    obj[key] = value
})

```
You can try: `JSON.stringify (yourArray);`. You can consult the documentation [here](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON). Tell me if you have some questions.