JSON.stringify()

Jmnote bot (토론 | 기여)님의 2017년 6월 27일 (화) 10:18 판 (봇: 자동으로 텍스트 교체 (-== 참고 자료 == +==참고==))

1 개요

JSON.stringify()
  • JSON을 문자열로 변환하는 JavaScript 함수

2 예시

<pre></pre>
<script src='//code.jquery.com/jquery.min.js'></script>
<script>
$('pre')
    .append( JSON.stringify({}) + "\n" )
    .append( JSON.stringify(true) + "\n" )
    .append( JSON.stringify('foo') + "\n" )
    .append( JSON.stringify( [1, 'false', false] ) + "\n" )
    .append( JSON.stringify( { x: 5 } ) + "\n" )
    .append( JSON.stringify( [1, 2, {a:'false', b:false}], "", "\t" ) );
</script>

3 같이 보기

4 참고

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}