title: How to update JavaScript asset map to return a dynamic field?
body: <p>How can I update the function I use with myAssetMap to handle cases when a match is not found? Given:</p>
  
  <pre><code>const myAssetMap = {
    Generic: {
      name: 'Generic',
      bkgHex: '#eee',
      fontHex: '#aaa',
    },
    Specific1: {
      name: 'Specific1',
      bkgHex: '#131sde',
      fontHex: '#FFF',
    },
    Specific2: {
      name: 'Specific2',
      bkgHex: '#131sde',
      fontHex: '#FFF',
    },
   ...
  </code></pre>
  
  <p>I can find values from myAssetMap like so:</p>
  
  <pre><code>const getAsset = (name, type) =&gt; {
    return return myAssetMap[name][type];
  }
  
  console.log( getAsset('Specific1', 'name') );
  console.log( getAsset('Specific2', 'name') );
  </code></pre>
  
  <p>This works great. but I need Generic to be dynamic.</p>
  
  <p>In the case where the asset is not found, example:</p>
  
  <pre><code>console.log( getAsset('XXXXXX', 'name') );
  </code></pre>
  
  <p>How can I have the above use Generic.bkgHex and Generic.fontHex, but have Generic.name be whatever is passed to the getAsset func. For example, the desired result would be:</p>
  
  <pre><code>console.log( getAsset('XXXXXX', 'name') );
  $ XXXXXX
  console.log( getAsset('XXXXXX', 'bkgHex') );
  $ #eee
  console.log( getAsset('XXXXXX', 'fontHex') );
  $ #aaa
  </code></pre>