title: JS callback using map() with a function that has one additional parameter
body: <p>I'm trying to find a way to use JS's <code>Array.prototype.map()</code> functionality with a function that has one additional parameter more (if possible at all, and I'd like to <em>avoid</em> having to rewrite built-in <code>Array.prototype.map()</code>).
  This documentation is very good, but does not cover the "one-or-more-additional-parameter" case:</p>
  
  <p><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/map">https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/map</a></p>
  
  <pre><code>function doOpSingle(elem)
  {
   // do something with one array element
  }
  
  var A = ["one", "two", "three", "four"];
  var x = A.map(doOpSingle); // this will execute doOpSingle() on each array element
  </code></pre>
  
  <p>So far, so good.
  But what if the function in question has <strong>two</strong> parameters, like e. g. a flag you might want to OR to it (think of bit masks)</p>
  
  <pre><code>function doOpSingle2(arrelem,flag)
  {
   // do something with one array element
  }
  
  var A = ["one", "two", "three", "four"];
  var theFlag = util.getMask(); // call external function
  var y = A.map(doOpSingle2(theFlag)); // this does not work!
  </code></pre>
  
  <p>Any solutions should do <strong>without</strong> <code>for</code> loops, of course, because that's why we have <code>map()</code>, to make our code cleaner w/getting rid of these!</p>