JSON to Object
parse(json)
const coder = {
name: 'Noran',
language: 'Javascript',
height: null,
birthDate: new Date(),
sayhi: () => {
console.log(`Hello, I'm ${name}!`);
},
};
json = JSON.stringify(coder);
const obj = JSON.parse(json);
console.log(obj);
//{name: 'Noran', language: 'Javascript', height: null, birthDate: '2022-07-12T03:03:18.870Z'}birthDate: "2022-07-12T03:03:18.870Z"height: nulllanguage: "Javascript"name: "Noran"[[Prototype]]: Object
์ถ์ฒ : ๋๋ฆผ์ฝ๋ฉ https://www.youtube.com/@dream-coding / MDN https://developer.mozilla.org/ko
'๐จ JavaScript > ๊ฐ๋ ' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[๋๋ฆผ์ฝ๋ฉ] ์ฝ๋ฐฑํจ์ (1) : ์ฝ๋ฐฑ์ง์ฅ ์์ (0) | 2022.07.22 |
---|---|
[mdn, ๋๋ฆผ์ฝ๋ฉ, ์ฝ๋ฉ์ ํ] ์ฝ๋ฐฑํจ์ (1) : ๋๊ธฐ์ ๋น๋๊ธฐ ๊ฐ๋ (0) | 2022.07.12 |
[๋๋ฆผ์ฝ๋ฉ] Object to JSON (stringify) (0) | 2022.06.29 |
[๋๋ฆผ์ฝ๋ฉ] JSON์ด๋? (0) | 2022.06.29 |
[๋๋ฆผ์ฝ๋ฉ] ์ ์ฉํ ๋ฐฐ์ด(array) api (3) : reduce, reduceRight, sort, api ๋ค์ค์ผ๋ก ์ฐ๊ธฐ (0) | 2022.06.15 |