title: Display results from array Javascript
body: <p>I need som help with my code. Sorry for the long list. I'm student and new at JS :) </p>
  
  <ol>
  <li>The result shows Name: Adress: Time: etc.</li>
  </ol>
  
  <p>I only want to show the information after the "": </p>
  
  <ol start="2">
  <li><p>If I only want to show parts of the array (price, time etc). How do I do?</p></li>
  <li><p>I want the button to be a link.</p></li>
  </ol>
  
  <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>let data = [{
  
          "name": "Sax &amp; Fön",
          "adress": "Rådmansgatan 46",
          "zip": "113 57 Stockholm",
          "time": "12",
          "tel": "08-522 389 20",
          "site": "www.salongweb.se",
          "rating": "(32)",
          "price": "320 kr",
          "timeEst": "30 min",
          "open": "Öppet till 19.00 idag",
          "desc": "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris"
      },
  
      {
          "name": "Hårizont",
          "adress": "Rådmansgatan 46",
          "zip": "113 57 Stockholm",
          "time": "12",
          "tel": "08-522 389 20",
          "site": "www.salongweb.se",
          "rating": "(32)",
          "price": "320 kr",
          "timeEst": "30 min",
          "open": "Öppet till 19.00 idag",
          "desc": "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris"
  
      }
  ];
  
  
  let page2 = (hairdresser) =&gt; {
      let singleView = "&lt;div&gt;";
      for (prop in hairdresser) {
          if (hairdresser.hasOwnProperty(prop)) {
              singleView += `&lt;p&gt;${prop} : ${hairdresser[prop]}&lt;/p&gt;`;
          }
      }
      singleView += "&lt;/div&gt;"
      document.body.innerHTML = singleView;
  }
  
  let handleData = (hairdressers) =&gt; {
      let out = "&lt;table&gt;";
      hairdressers.forEach((hairdresser, index) =&gt; {
          out += "&lt;tr&gt;";
          for (let prop in hairdresser) {
              if (hairdresser.hasOwnProperty(prop)) {
                  let isName = prop === "name";
                  out += `&lt;td&gt;
          ${isName ? `&lt;button onclick='page2(${JSON.stringify(hairdresser)})'}&gt;` : ""}  
            ${prop}${hairdresser[prop]}
          ${isName ? '&lt;/button&gt;' : ""}
          &lt;/td&gt;`;
              }
          }
          out += "&lt;/tr&gt;";
      })
      out += "&lt;/table&gt;";
  
      document.body.innerHTML = out;
  
  }
  
  handleData(data);</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;html&gt;
  &lt;body&gt;
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>