자바스크립트 썸네일형 리스트형 JSON.stringify() 메소드 [혼공자 6-2-3] JSON.stringify() 메소드는 객체를 JSON 문자열로 변환한다. 코드를 보자. // 자료를 생성합니다. const data = [{ name: '혼자 공부하는 파이썬', price: 18000, publisher: '한빛미디어' },{ name: 'HTML5 웹 프로그래밍 입문', price: 26000, publisher: '한빛아카데미' }] // 자료를 JSON으로 변환합니다. console.log(JSON.stringify(data)) console.log(JSON.stringify(data, null, 2)) console.log(JSON.stringify(data)) 에서처럼 파라미터를 하나만 넣으면 한줄로 쭉 이어서 출력된다. console.log(JSON.stringify(dat.. 더보기 이전 1 2 3 4 다음