score:1

Accepted answer
  <div id="table">
    {allFeatureKeys.map((featureKey) => {
       return <div id="table-row">
         <div>{featureKey}</div>
         <div>
           { 
             modifiedCurrentProd.features[featureKey] !== undefined 
               ? modifiedCurrentProd.id 
               : "n/a"
           }
         </div>
         <div>
           {
             modifiedClickedProd.features[featureKey] !== undefined
               ? modifiedClickedProd.id
               : "n/a"
           }
         </div>
       </div>
     })}
  </div>

score:0

.as-console-wrapper { min-height: 100%!important; top: 0; }

score:1

<script>
  const currentProduct = {
    id: 28212,
    name: "Camo Onesie",
    // ... more properties ...
    features: [{
      feature: "Fabric",
      value: "Canvas",
    }, {
      feature: "Buttons",
      value: "Brass",
    }],
  };
  const clickedProduct = {
    name: "Morning Joggers",
    // ... more properties ...
    id: 28214,
    features: [{
      feature: "Fabric",
      value: "100% Cotton",
    }, {
      feature: "Cut",
      value: "Skinny",
    }],
  };
</script>

Related Query

More Query from same tag