Here is an example to illustrate the desired behaviour:
processNames : function () {
var names = getNames();
// This is desired:
processName(one);
// Whereas this is required:
processName(names.one);
},
processName: function (name) {
// TODO
return name;
},
getNames : function () {
return [
one = "Bob",
two = "Alan",
three = "Ben"
];
}
The desired output is a variable in local scope, one for each element of the names
array, where the variable's name is its key within the array and its value is its corresponding value.