goal
- json() 과 JSON.parse, JSON.stringify 헷갈리는 표현 알아보기
json()
은 fetch 전용 기능이다..html
, .text
등도 사용가능)let obj = {user : "delilah", city : "seoul"}
let makeJson = JSON.stringify(obj)
console.log(makeJson) // "{"user":"delilah","city":"seoul"}
"
let makeObj = JSON.parse(makeJson)
console.log(makeObj) // {user: "delilah", city: "seoul"}