var countries1 = {
KR: 'South Korea',
JP: 'Japan',
GU: 'Guam',
US: 'United States',
CH: 'Switzerland',
IT: 'Italy',
PH: 'Philippines',
HK: 'Hong Kong',
CA: 'Canada'
};
alert(countries1.KR);
alert(countries1['KR']);
이렇게 두가지 방법이 접근 가능하다.
var countries2 = ['South Korea','Japan','Guam', 'United States', 'Switzerland', 'Italy', 'Philippines', , 'Hong Kong', 'Canada'];
alert(countries2[0]);
배열이니 인덱스로~
으흐~ 내가 가본 나라닷..^^
태그 : json




덧글