多次元の連想オブジェクトを作成する必要があり、部分的に機能しています。
簡易版:
var sources = {
tales: ['some content', 'some more content'],
thehut: ['some content', 'some more content']
};
「一部のコンテンツ」と「その他のコンテンツ」にエイリアスを付けたいだけですが、正しく機能させることができません。
多次元の連想オブジェクトを作成する必要があり、部分的に機能しています。
簡易版:
var sources = {
tales: ['some content', 'some more content'],
thehut: ['some content', 'some more content']
};
「一部のコンテンツ」と「その他のコンテンツ」にエイリアスを付けたいだけですが、正しく機能させることができません。
これはあなたが意味するものですか?
var sources = {
tales: {name1:'some content', name2:'some more content'},
thehut: {name1:'some content', name2:'some more content'}
};
「エイリアス」で何を指しているのかわかりませんが、これはあなたが望むものですか?
var sources = {
tales : {some_content: 'content 1', some_more_content: 'content 2'},
thehut: {some_content: 'content 3', some_more_content: 'content 4'}
};
これを次のように使用します。
> sources.tales.some_content
"content 1"