title: Understanding how reduce can be used instead of map and join in this function
body: <p>I've got the following function that gets all checked checkboxes on my html form with the given element Name.  I have a loose understanding that a reduce function can replace the .map and .join sections so was looking for a poke in the right direction of how to implement that and also if there is any other steps I could take to optimise this function?</p>
  <pre><code>  function getCheckedValuesOf(elmName){
      return [...document.getElementsByName(elmName)].filter(box=&gt;box.checked==true).map(box=&gt;box.value).join(&quot;, &quot;)
    }
  </code></pre>