how to search an array of objects

how to search an array of objects

with an array of objects how would you check a string within the array


  1. function AttributeNodeClass(name, type, klass, description, controls) {
  2.     this.name = name
  3.     this.type = type
  4.     this.class = klass
  5.     this.description = description
  6.     this.controls = controls
  7.     this.dump = function(){
  8.         console.log(this)
  9.     }
  10. }

  11. function ANCList() {
  12.     var list = []
  13.     this.add = function (attributeNodeClass) {
  14.         list.push(attributeNodeClass)
  15.         return this
  16.     }
  17.     this.dump = function () {
  18.         $.each(list, function (i, anc) {
  19.            anc.dump()
  20.         })
  21.         return this
  22.     }