I have a component that throws the following in the backend
memberSince: [ '["2022-05-05T08:13:07.551Z","2022-06-01T08:13:07.551Z"]' ]
Is there a way to un-stringify the array content like memberSince[0].parse()
or something
I have a component that throws the following in the backend
memberSince: [ '["2022-05-05T08:13:07.551Z","2022-06-01T08:13:07.551Z"]' ]
Is there a way to un-stringify the array content like memberSince[0].parse()
or something
You can use JSON.parse()
const data = {memberSince: ['["2022-05-05T08:13:07.551Z","2022-06-01T08:13:07.551Z"]']}
const result = JSON.parse(data.memberSince)
console.log(result)