I believe that you confusing Array and Object. To easily explain I'm going to use literal syntax.
Arrays are represented by [].
Arrays doesn't have keys, so you can't use like that. Arrays keys are dynamically ordered index.
var CatTitle = [
'Travel',
'Daily Needs',
'Food & Beverages',
'Lifestyle',
'Gadget & Entertainment',
'Others',
]
And Objects are represented by {}.
var myObj = {
exp : 'xxx',
couponcode : 'xxx',
}
If you'd like to push some object into the array, use CatTitle.push({ exp: 'xxx' }). So that you will have an array like this.
var CatTitle = [
'Travel',
'Daily Needs',
'Food & Beverages',
'Lifestyle',
'Gadget & Entertainment',
'Others',
{ exp: 'xxx' }, // <-- you pushed here at last index (6)
];
CatTitle[6] // { exp: 'xxx' }
But I believe that you're looking for an object of objects. Like this:
var CatTitle = {
'Travel': [{ exp: 'xxx' }, { exp: 'yyy' }],
'Daily Needs': [],
'Food & Beverages': [],
'Lifestyle': [],
'Gadget & Entertainment': [],
'Others': [],
};
CatTitle['Travel'] // [{ exp: 'xxx' }, { exp: 'xxx' }]
CatTitle['Travel'][0] // { exp: 'xxx' }
I see that you're starting learning JavaScript. I recommend you to read the docs about Arrays and Objects.
Other commendation is about semantic, never create variables in capital. Avoid creating keys as string, but I believe that you want it like something dynamic, in this case ok.
A good example:
var catTitles = {
'Travel': [{ exp: 'xxx' }, { exp: 'yyy' }],
'Daily Needs': [],
'Food & Beverages': [],
'Lifestyle': [],
'Gadget & Entertainment': [],
'Others': [],
};
catTitles['Travel'] // [{ exp: 'xxx' }, { exp: 'xxx' }]
catTitles['Travel'][0] // { exp: 'xxx' }
// you can add another category like this
catTitle['Restaurants'] = [{ exp: 'xxx' }];