Currently, I am working with a JSON string that represents an array.
arrayString = "[
{ fName: 'John', lName: 'Doe'},
{ fName: 'Jane', lName: 'Doe'},
{ fName: 'Josh', lName: 'Doe'},
{ fName: 'Jack', lName: 'Doe'},
{ fName: 'Jill', lName: 'Doe'},
{ fName: 'Josh', lName: 'Doe'},
{ fName: 'Jean', lName: 'Doe'},
{ fName: 'Jake', lName: 'Doe'},
{ fName: 'Judy', lName: 'Doe'},
{ fName: 'Jery', lName: 'Doe'},
]";
I am facing an issue where parsing all the elements in one go using .json() method is causing high memory consumption due to the sheer volume of data. To address this, I am looking for a solution to parse only the first n rows from the array, mimicking client-side pagination for retrieving data efficiently from the string. However, it's important to note that I have no control over how this extensive dataset is sent from the server.