title: Why is the result string returns only last result value
body: <p>I have a code which takes some values from input fields the user inputs. My JS code is supposed to check whether all required titles are not empty. If not, it should display <code>alert</code> message with the result. Here's my code</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>var result = "";
  function isStringEmpty(string2Check) 
  {
      return string2Check == "" || string2Check[0] == " ";
  };
  var titles = 
  [
      ["1", "This is 1st title(not empty)"],
      ["", "Suppose this is empty"],
      ["", "Suppose this is empty too"]
  ];
      
  var titlesMap = new Map(titles);
  
  titlesMap.forEach(function(key, value, titlesMap) 
  {
      if(isStringEmpty(value)) 
      {
          result += 'Field ' + '"' + key + '"' +' cannot be empty!\n'
      }
  });
  result = result.replace(/\n$/, "");
  alert(result);</code></pre>
  </div>
  </div>
  </p>
  
  <p>See? The "Suppose this is empty" is ignored(the result string doesn't contain it) :( and the <code>result</code> only takes the last result message. Why? BTW, why are the <code>key</code> and the <code>value</code> properties in the map are messed up?(I thought that key is "1" and value is "This is 1st title(not empty)", but it's not..) I guess that this is because of using arrays as properties...</p>