Front-End/Node.js

[Node.js] json(JavaScript Object Notation)

챌링킴 2021. 8. 14. 17:51
반응형

1) json(JavaScript Object Notation)이란?

- 데이터를 교환하고 저장하기 위해 만들어진 텍스트 기반의 데이터 교환 표준 포맷입니다.

 

{
  "apple": {
    "name": "김사과",
    "password": "1111",
    "gender": "여자"
  },
  "banana": {
    "name": "반하나",
    "password": "2222",
    "gender": "여자"
  },
  "orange": {
    "name": "오렌지",
    "password": "3333",
    "gender": "남자"
  },
  "melon": {
    "name": "이메론",
    "password": "4444",
    "gender": "남자"
  }
}

 

 

** json 문법 검증하는 사이트

https://jsonlint.com/

 

The JSON Validator

JSONLint is the free online validator and reformatter tool for JSON, a lightweight data-interchange format.

jsonlint.com

 

 

2) json 메소드

 

1. json.parse( )

- json 포맷으로 되어 있는 문자열을 json 객체로 변환해준다.

- JSON.parse(string 문자열)

 

2. json

반응형