cancel
Showing results for 
Search instead for 
Did you mean: 

Convert an Array to an Object

KevinFord
New Contributor

I need to convert an array to an object.  this is my array:

[
  {
    "totalMatchingRows": 2,
    "pageCount": 1,
    "pageSize": 1000,
    "pageIndex": null,
    "rowsInPage": 2
  }
]
 
I need to convert it to:
{
  "totalMatchingRows": 2,
  "pageCount": 1,
  "pageSize": 1000,
  "pageIndex": null,
  "rowsInPage": 2
}
 
1 REPLY 1

koryknick
Employee
Employee

@KevinFord - you could either just get the first index of the array

$arrayField[0])

or use the Array.pop() method

$arrayField.pop()

Hope this helps!