I have the following variable (given to me through a HTTP response, hence the string):
var result = '[{name: "John"}, {name: "Alice"}, {name: "Lily"}]'
In reality there are more objects and each object has more properties, but you get the idea.
When trying JSON.parse(result)
I get the following error:
[{name: "John"}, {name: "Alice"}, {name: "Lily"}]
^
SyntaxError: Unexpected token n
How can I parse this string into an array of javascript objects?