how to fix Unexpected token } in JSON at position 366 code example Example: unexpected token s in json at position 0 var s = '"something"'; var result = JSON.parse(s);