Skip to content

Instantly share code, notes, and snippets.

@sorie
Created July 1, 2021 08:52
Show Gist options
  • Save sorie/928111dec1107e698466142667c15680 to your computer and use it in GitHub Desktop.
Save sorie/928111dec1107e698466142667c15680 to your computer and use it in GitHub Desktop.
json에 대한 모르던 사실
/**
json 모르던 사실
1. json안에서 함수사용가능하지만 stringify후 object로 바꾸면 함수는 사라진다.
2. stringify사용시 특정 값만 나오게 할수 있다.
3. stringify사용시 콜백함수를 사용할 수 있다.
**/
json = JSON.stringify(rabbit);
json = JSON.stringify(rabbit, ['name','color','size']);
json = JSON.stringify(rabbit, (key, value) => {
console.log(``);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment