프론트엔드 센트럴파크 (☞゚ヮ゚)☞

JSON 본문

Javascript

JSON

자라나라나무나무나 2022. 7. 3. 21:06
const obj = {x : 5, y : 6};

const json = JSON.stringify({x : 5, y : 6});
const jsonParseObj = JSON.parse(json);

console.log(typeof obj); // object
console.log(typeof json); // string
console.log(typeof jsonParseObj); // object

- JSON Parse (서버에서 데이터를 가져올 때)

JSON → "JS Object" 

 

- JSON Stringify (서버로 데이터를 보낼 때)

"JS Object" JSON

'Javascript' 카테고리의 다른 글

for..of 반복문  (0) 2022.07.14
slice()  (0) 2022.07.14
findIndex() - 배열의 값 검색  (0) 2022.06.11
map(), filter()  (0) 2022.06.10
객체 속성 배열로 꺼내기 - Object.keys() , Object.values(), Object.entries()  (0) 2022.06.08
Comments