That means when we reach 3, the start of a new string using double quotes, it's an unexpected string. You probably want: ... At 1, we start the string. 2 is just a " within the string, it doesn't end it. 3 ends it, then we append checkval, then we start a new string (4) with a " in it (5) followed by a ] and then the end of the string (6).

One other gotcha that can result in "SyntaxError: Unexpected token" exception when calling JSON.parse() is using any of the following in the string values: New-line characters.

CNBC: Unexpected expenses take 10% of retirees' income, on average, research shows — many don't have enough cash on hand

Unexpected expenses take 10% of retirees' income, on average, research shows — many don't have enough cash on hand

The Motley Fool: Why Can Some Retirees Work and Still Collect Social Security Benefits and Others Can't?

Some retirees can work as much as they want when collecting benefits, but others can't. Know the work rules to avoid delaying some of your hard-earned Social Security income. Retirees who work may ...

Why Can Some Retirees Work and Still Collect Social Security Benefits and Others Can't?

Standard-Examiner: Layin’ It on the Line: How retirees are using a little-known IRS rule to cover care costs without paying Uncle Sam

Layin’ It on the Line: How retirees are using a little-known IRS rule to cover care costs without paying Uncle Sam