0

I have this string

astring='[{"name": "daus", "total": "45", "ios": "30", "android": "15"},{"name": "davus", "total": "38", "ios: 27", "android": "11"}]'

and I want to convert it to JSON via

ajson = JSON.parse(astring)

but I receive this error:

JSON::ParserError: 399: unexpected token at '{"name": "davus", "total": "38", "ios: 27", "android": "11"}]'

I'm assuming my error is in the way I'm setting up the initial string but haven't been able to solve it yet.

1 Answer 1

2

Syntax error:

"ios: 27" -> "ios": "27"
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.