title: print full path javascript
body: <p>This is the result I am getting from my database when I do a query:</p>
  
  <pre><code>[
      {
          "name": "file1.txt",
          "id": 1,
          "file_path": ".&amp;#x2F;public&amp;#x2F;files&amp;#x2F;file1.txt"
      }
      {
          "name": "file3.txt",
          "id": 3,
          "file_path": ".&amp;#x2F;public&amp;#x2F;files&amp;#x2F;file3.txt"
      },
      {
          "name": "file4.txt",
          "id": 8,
          "file_path": ".&amp;#x2F;public&amp;#x2F;files&amp;#x2F;file4.txt"
      },
      {
          "name": "file5.txt",
          "id": 7,
          "file_path": ".&amp;#x2F;public&amp;#x2F;files&amp;#x2F;file5.txt"
      }
  ]
  </code></pre>
  
  <p>And what I want to print is this kinda of format of file path <strong>./public/files/file1.txt</strong></p>
  
  <p>This is what I am trying right now but it doesn't seem to work:</p>
  
  <pre><code>var paths = [];
  if(result.length &gt; 0) {
      var tmp_path = result[0].file_path
  
      var count = 0
  
      result.forEach(element =&gt;  {
          count++
          tmp_path = element.file_path
          paths.push(decodeURI(tmp_path))
      })
      console.log(JSON.stringify(paths,null,4))
  }
  </code></pre>
  
  <p>The result I get is this:</p>
  
  <pre><code>[
  ".&amp;#x2F;public&amp;#x2F;files&amp;#x2F;file1.txt",
  ".&amp;#x2F;public&amp;#x2F;files&amp;#x2F;file3.txt",
  ".&amp;#x2F;public&amp;#x2F;files&amp;#x2F;file4.txt",
  ".&amp;#x2F;public&amp;#x2F;files&amp;#x2F;file5.txt",
  ]
  </code></pre>
  
  <p>Isn't decodeURI() the function I am supposed to use in this case?</p>
  
  <p>I am working on Node.js with router and ejs npms. So this is part of a get function and the result will be populated in front-end with ejs. So what I am trying to do is to pass the correct format on the result which is <strong>PATHS</strong></p>