You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's weird that its even working, given that this code is trying to JSON.parse an already parsed object. I'm pretty sure the whole thing can be replaced by values[0]. I'll test it
I looked into it a bit deeper and here is what I've found, the study, a.k.a. values[0], is saved as a JSON string. Now apparently, you can stringify a JSON string (I've tested it by running JSON.stringify(JSON.stringify({a: 1, b: 2}))). This will give a strange result though. All in all, whats happening here is:
the values[0] JSON string gets stringified JSON.stringify(values[0])
the JSON stringified string, gets unstringified, resulting in a normal JSON string JSON.parse(JSON.stringify(values[0]))
the JSON string gets unstringified and is therefore finally a javascript object JSON.parse(JSON.parse(JSON.stringify(values[0])))
which leads to the conclusion, that this should be replaceable by JSON.parse(values[0])
momenTUM-app/src/app/services/survey-data/survey-data.service.ts
Line 77 in 148b742
The text was updated successfully, but these errors were encountered: