As I mentioned in THIS QUESTION, I have problem when getting the response from the server.
I receive an array of objects with these attributes:
[{
\"
function replacer(key, value) {
// Filtering out properties
if (key === 'Id') {
return value.toString();
}
return value;
}
const t = [{
"Id": 143187001116603, // VERY big number which I want to convert it to string
"Name": "تملی612", // string
"Title": "تسهیلات مسکن بانک ملی-اسفند96", // string
"InsCode": "IRO6MELZ96C1" // string
},
{
"Id": 9481703061634967, // VERY big number which I want to convert it to string
"Name": "تملی232", // string
"Title": "تسهیلات مسکن بانک ملی-اسفن216", // string
"InsCode": "IRO6MSDZ96C1" // string
}
]
const stringifiedValue = JSON.stringify(t, replacer)
console.log(JSON.parse(stringifiedValue))
Try this using replacer callback for JSON.stringify.
Feedbacks welcome.