Answer the question
In order to leave comments, you need to log in
How to pass an array of objects through a query string?
the bottom line is that you need to pass different lengths of the array after making it a string, I rest on the fact that there is only one method that can make a string back into an array on the server, and this is split (
String.prototype.split ())
Punched something like this
const arrData = [
{id: 456239605, count: 4980},
{id: 456239566, count: 9733},
{id: 456239460, count: 15746},
{id: 456239444, count: 18883},
];
const dataString = arrData.map((elObj)=>{
return JSON.stringify(elObj)
}).join('||')
console.log(dataString);
console.log(dataString.split('||'));
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question