title: Accessing array object property in vue.js
body: <p>Given the following array in <code>vue.js</code>:</p>
  
  <pre><code>packageMaps: Object
      packageMap_0: Object
          Id: 16
          PackageType: "flag_list"
          ProductCode: "F-BannerBase"
      packageMap_1: Object
          Id: 82
          PackageType: "flag_list"
          ProductCode: "F-TeardropBanner"
      ....
  ....
  </code></pre>
  
  <p>...and given the value <code>F-TeardropBanner</code>, how can I access the given array and return the relevant <code>PackageType</code>?</p>
  
  <pre><code>populatePackageList(productCode) {
    let packageList = [];
    let packageType = '';
    for(let key in this.packageMaps.ProductCode) {
        if(productCode === this.packageMaps[key];
        // not sure what to do here or if I am on the right track
    }
    this.formData.packageList = Object.assign({}, this.formData.packageList, packageList);
  },
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/7MaFc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7MaFc.png" alt="Array as it appears in vue.js"></a></p>