title: Check if cookie exists else set cookie to Expire in 10 days
body: <p>Here is what I'm looking to do (pseudo-code):</p>
  
  <p>Imagine the name of the cookie in the example is "visited" and it contains nothing.</p>
  
  <pre><code>if visited exists
  then alert("hello again");
  else
  create visited - should expire in 10 days;
  alert("This is your first time!")
  </code></pre>
  
  <p>How can I achieve this in JavaScript?</p>