I am using tag inputs to submit a string representation of 0 or more objects. The input
value in the form is a comma separated list of stringified JSON objects.
Example:
var value = "{}, {}, {}, {}"
Each of the individual objects have a field containing a name: {..., name: "Doe, John"}
Because this comma is here I cannot execute JSON.parse(value)
Unexpected token , in JSON at position ...
I want to avoid doing any string split methods because of undesired splitting of names.
Add brackets to the string and it will parse correctly
var value = "{}, {}, {}, {}, {}"
JSON.parse("[" + value + "]")