how can I parse all object values inside of an array of objects into strings? example of my obj:
// my array of objects
[
{
prop1: 23123 ---> to "23123"
prop2: "asda"
prop3: "cmcmcm22"
prop4: 23312 ---> to "23312"
....
},
{
prop1: 23123 ---> to "23123"
prop2: "asda"
prop3: "cmcmcm22"
prop4: 23312 ---> to "23312"
....
}
...
]
// what i tried
obj.forEach( (element: any) => {
Object.values(element).forEach((value:any) =>{
if(!isNaN(value)){
value = value.toString();
}
})
});
but the above code doesn't work.
thanks in advance!