var source = {
'one': {
id: 1,
name: 'Name1',
},
'two': {
id: 2,
name: 'Name2',
}};
console.log(source['one']['name']);
console.log(source['two']['name']);
Name1
Name2
var storage = {
id1: {one: 1, two: 2},
id2: {one: 1, two: 2}
}
var one = storage["id1"]["one"];
var one = window["id1"]["one"];
Find more questions by tags CoffeeScriptJavaScriptjQuery
two = {two: ['three', 'four', 'five']}
id = "#{$(this).attr('id')}" (will return one or two)
id.two[0] - does not work - Shakira.Pouro commented on July 9th 19 at 10:17
- Korey.Quigley commented on July 9th 19 at 10:23