Convert an Array to an Object
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2023 07:48 AM
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
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2023 10:06 AM
@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!