In my array, I have no.of instance label with code. But i required just one from the first instance. I used the find method. But i am getting error.
here is my try:
var ob = {
"name" : [
{"code" : ""},
{"code" : "1"},
{"code" : "1"},
{"code" : "1"},
{"code" : "1"}
]
}
var code = _.find(ob.name, "code");
console.log(code); //error as "undefined is not a function"
the method which is use here is wrong? can any one guide me the correct one please?
_.find. What did you think would a string do?