title: Check if subdomain is true or false? javascript
body: <p>Newbie here and I've been trying to write a function that checks if a subdomain is true or false</p>
  <p>any guidance is appreciated! and sorry if it's really basic</p>
  <pre><code>function test(t) {
    if (window.location.hostname === 'news.google.com') {
      return true;
    }
    return t;
  }
  let x;
  console.log(test(x));
  </code></pre>