title: How to put a newline in the message of a new Error object Javascript?
body: <p>I have a function in a service something like this: </p>
  
  <p><code>Policies</code> is a list of functions that will <strong>throw an error</strong> if a policy is   violatted (e.g.  password does not have numbers or capital letters)</p>
  
  <pre><code> function myFunction(policies, password){ 
    var policiesError = ''; 
    policies.forEach(function(policy) {      
      try {
        policy(password, payload);
      } catch (err) {
        policiesError += err.message + '\n';   // Also tried `concat()`
      }
    });
    if (policiesError){
      throw new Error(policiesError);
    }
  }
  </code></pre>
  
  <p>And in a my <code>controller</code> I have:</p>
  
  <pre><code>try{
    myService.myFunction(myFunctions, 'password');
  } catch (err){
    $scope.policiesError = err.message; // Which is used in as {{policiesError}} to display   
  }
  </code></pre>
  
  <p>The result of the message in the controller is something like:</p>
  
  <pre><code>"Password too shortPassword has no lettersInvalid characters in password"
  </code></pre>
  
  <p>but I actually need it to be:</p>
  
  <pre><code>"Password too short
  Password has no letters
  Invalid characters in password"
  </code></pre>
  
  <p>It's quite simple, but I've banged my head against the table for a while and it's quite frustrating.</p>
  
  <p>Any suggestions on how to achieve a nice formatted message  using <code>new Error</code> and catching it?</p>