프로그래밍/Etc

javascript json 객체에 키와 값 추가 방법

kugancity 2018. 11. 9. 20:02
반응형


참고: https://gent.tistory.com/21



JSON 객체에 키(key)와 값(value)를 추가하고 삭제하는 방법


var json = {NAME: "John", AGE: 30, SEX: "male"};


//add item (key, value)

json.BIRTHDAY = '2001-03-01';


//delete item (key)

delete json.SEX;






728x90
반응형