I have an observableArray, I have a name "Zippy", I need to check if it is in the array. if this name exists, I need to get its type. how should I do that?
// This observable array initially contains three objects
var anotherObservableArray = ko.observableArray([
{ name: "Bungle", type: "Bear" },
{ name: "George", type: "Hippo" },
{ name: "Zippy", type: "Unknown" }
]);
Try this, you can use
ko.utils.arrayFirstfunction for checking an element with your custom logic..