title: Printing a string pattern in javascript
body: <p>I have to print a pattern like this accepting a string as input.</p>
  
  <pre><code>EAGLE
  AGLEE
  GLEEA
  LEEAG
  EEAGL
  EAGLE
  </code></pre>
  
  <p>How can i print like this?</p>