Home > database >  JSON.stringfy return data different compared with the object
JSON.stringfy return data different compared with the object

Time:03-03

I have some code:

console.log("444444: ", profile, JSON.stringify(profile))

when I check the log:

log

Basically I want to know why I can not see

value: [0]

and i want to pass this profile object to backend and looks like backend is not getting this value field.

CodePudding user response:

Probably, you remove profile.value somewhere after you outputted it to console.log(). Try looking for delete profile.value; or profile.value = undefined;.

CodePudding user response:

Try to parse the data first and then stringify

JSON.parse(JSON.stringify(profile)) 
  • Related