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: 
You can use `map` function which will return an array.That array will contain the required object. Use the split function to split the string.

```js
var oldArray = [
  "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"
]
// Executing same function on the element
var newObject = oldArray.map(function(item) {
  // spliting a string
  var splitValue = item.split('=');
  this[splitValue[0]] = splitValue[1]
  return this;
}, {})
console.log(newObject[0])
```
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.