title: What is best practice to run a custom function on specific values of an array of objects in JavaScript?
body: <p>Let's say I have two functions and an array of objects:</p>
  <pre><code>const f1 = (v) =&gt; {
     return v.toUpperCase();
  }
  const f2 = (v) =&gt; {
     return v.toLowerCase();
  }
  const arrayOfObjects = [
     {
        v1: &quot;foo&quot;,
        v2: &quot;bar&quot;,
        v3: &quot;foobar&quot;,
     },
     {
        v1: &quot;foo2&quot;,
        v2: &quot;bar2&quot;,
        v3: &quot;foobar2&quot;,
     },
     ...
  ];
  </code></pre>
  <p>How can I update my array and run <code>f1</code> on the <code>v1</code> property of each objects and <code>f2</code> on the <code>v2</code> property of each object?
  In my real app, I'd like to format timestamps and usernames with this method.</p>