[Solved] How to define my variable structure?


Notice that the object presented by @juvian does not have a defined ordering of the keys (in contrast to PHP associative arrays, for example). I guess you want an ordered collection, for which you have to use an array:

var collection = [
    {'title': '1', 'subtitle':'sub1', 'contents':'sub content 1'},
    {'title': '2', 'subtitle':'sub2', 'contents':'sub content 2'},
    {'title': '3', 'subtitle':'sub3', 'contents':'sub content 3'}
];

solved How to define my variable structure?