There are two ways to add new properties to an object:

var obj = {
    key1: value1,
    key2: value2
};



Using dot notation:

obj.key3 = "value3";



Using square bracket notation:
obj["key3"] = "value3";






http://hangaebal.blogspot.kr/2014/06/javascript-key-value-array.html

http://stackoverflow.com/questions/1168807/how-can-i-add-a-key-value-pair-to-a-javascript-object-literal



'Blogger 이사' 카테고리의 다른 글

[SQL] SQL get last row  (0) 2016.01.14
[JavaScript] key, value Array Sort  (0) 2016.01.14
[jQuery] jQuery 이벤트 호출  (0) 2016.01.14
[Javascript] window.load vs document.ready  (0) 2016.01.14
[SQLite] Web SQL INSERT OR ...  (0) 2016.01.14

+ Recent posts