취미와 밥줄사이
[JSON] Data Types 본문
유효한 데이터 유형
JSON에서 data types은 다음 중 하나입니다.
- a string
- a number
- an object(JSON object)
- an array
- a boolean
- null
JSON 값은 다음 데이터 유형 중 하나일 수 없습니다.
- a function
- a date
- undefined
JSON Strings
JSON에서 문자열은 큰따옴표로 묶어야합니다.
{"name":"John"}
JSON Numbers
JSON의 숫자는 정수 또는 부동 소수점이어야 합니다.
{"age":30}
JSON Objects
JSON의 값은 객체가 될 수 있습니다.
{
"employee":{"name":"John", "age":#0, "city"L"New York"}
{
JSON의 값인 객체는 JSON 구문을 따라야 합니다.
JSON Arrays
JSON의 값은 배열일 수 있습니다.
{
"employees":["John", "Anna", "Peter"]
}
JSON Booleans
JSON의 값은 참/거짓일 수 있습니다.
{"sale":true}
JSON null
JSON의 값은 null일 수 있습니다.
{"middlename":null}
REFERENCE
https://www.w3schools.com/js/js_json_datatypes.asp
JSON Data Types
W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.
www.w3schools.com