Spot the bug: one character breaks this JSON

2026-11-05来源 dev.to JavaScriptEnglish
Spot the bug: one character breaks this JSON

Quick puzzle 🧩

The JSON in the image looks fine, but JSON.parse() rejects it, and so will most APIs.

One character is the problem. Which line is it on?

Hint: it's a habit JavaScript allows and JSON doesn't.

Comment your line number. We'll post the answer this evening.

When you hit "Unexpected token" for real, paste the JSON into a validator before you hunt through a 500-line file: https://seopeck.com/tool/json-validator

原文:https://www.a8q9.cn/en/article/spot-the-bug-one-character-breaks-this-json-fa5db5.html

相关文章