title: How do I change a single quote of an array.element (that is inside an object) into a double quote without creating a new array?
body: <p>I was told to try and use a certain code for one of the problems I solved a while ago. I'm trying to figure it out but am coming up with nada.
  Using replace(), map() etc..
  This is all supposed to be done using replit and not changing the whole array as part of the 'For Fun' challenge.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const products = [
    {
      priceInCents: 3995,
    },
    {
      priceInCents: 2500,
    },
    {
      priceInCents: 8900,
    },
    {
      priceInCents: 12500,
    },
  ];
  
  /* Now trying to use:
  products[i].priceInDollars = $${(products[i].priceInCents * .01).toFixed(2)}
  */
  
  /*
    New 
      Code
          */
  
  
  function addPriceInDollarsKeyToProducts(pricey)
  { for (let i = 0; i &lt; products.length; i++)  
      { for (let product = products[i];
        product.priceInDollars = `$${(product.priceInCents * .01).toFixed(2)}`; )
        
        break;
      } 
      
  }
  
  addPriceInDollarsKeyToProducts();
  console.log(products)</code></pre>
  </div>
  </div>
  </p>
  <p>Running this snippet btw makes it seem like it's okay.</p>
  <p>For example: I want products[0].priceInDollars to be <code>&quot;$39.95&quot;,</code>
  but instead I get <code>'$39.95',</code>
  Snippet runs it as <code>&quot;$39.95&quot;</code></p>
  <p>I'm not supposed to recreate the whole entire array.</p>
  <p>If the code doesn't match the double quote requirements I get <code>TypeError: Cannot read property '0' of undefined</code></p>
  <p><em>edited for clarification purposes</em></p>