I have the following code:
data_array = {
full_name: 'fullname',
items: [],
address_full: 'address'
};
first = {
'data-opPrice' : '1a',
'data-stdPrice' : '1b',
'state' : '1c'
};
second = {
'data-opPrice' : '2a',
'data-stdPrice' : '2b',
'state' : '2c'
};
data_array.items.push(first);
data_array.items.push(second);
alert(data_array['items'][1].data-opPrice);
I would expect to get the alert "2a". But nothing happens. Why?