Here is the solution (by the way, this is an object, not an array):
var obj = {"one":"1","two":"3","three":"5","four":"1","five":"6"}; var myFunc = function(thisObj, property) {console.log(obj[property])}; myFunc(obj, "two");
You can also do this more easily using the _.pluck function from the JS Underscore library.
Boshika tara
source share