I have an array called: "additions_colorizing_items". It has objects inside it, as seen below:
var additions_colorizing_items = [
'',
{
"name": 'viking_helmet',
"actual_name": 'Viking Helmet',
"rows": 4,
"first_color": '#ED2C2B',
"started_color": 4,
"type": 'H',
"type_in_words": 'head',
"have_shadow_now": 'always',
'need_shadow': false
},
{
"name": 'hard_hat',
"actual_name": 'Hard Hat',
"rows": 4,
"first_color": 1,
"started_color": '#F6EB56',
"type": 'H',
"type_in_words": '',
"have_shadow_now": 'always',
'need_shadow': false
}, ....]
The problem is that $.inArray function doesn't work in this case:
this_id = 'viking_helmet';
alert(additions_colorizing_items[$.inArray(this_id, additions_colorizing_items.name)].actual_name);
The goal is: turning name to actual_name from the same object inside the array for example: viking_helmet -> Viking Helmet