Get to know MDN better
This page was translated from English by the community. Learn more and join the MDN Web Docs community.
JSON.parse()에서 문자열을 JSON 구문으로 파싱하지 못했을 때 JavaScript 예외가 발생합니다.
JSON.parse()는 문자열을 JSON으로 파싱합니다. 이 문자열은 유효한 JSON 형태의 문자열이어야 하며, 유효하지 않을 경우 에러가 발생합니다.
다음 두 줄 모두 SyntaxError가 발생합니다.
JSON으로 정확하게 파싱하기 위해 trailing comma를 제거하세요.
'foo'처럼 속성을 작은따옴표로 감싸서는 안 됩니다.
대신 "foo"처럼 작성해야 합니다.
01처럼 선행 0은 사용할 수 없습니다. 소수점 뒤에는 최소한 한 자리 이상의 숫자가 필요합니다.
대신 0 없이 1만 작성하고 소수점 뒤에 한 자리 이상의 숫자를 작성합니다.
This page was last modified on 2024년 1월 30일 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.