title: Find Nearest square number of a given number
body: <p>The task is to find the nearest square number, nearest_sq(n), of a positive integer n (taken from codewars). I've tried the below but just get an infinite loop.</p>
  
  <pre><code>while(Math.sqrt(n)%1!==0){
      n-- || n++
  }
  return n;
  </code></pre>
  
  <p>Can someone point out where I am wrong in my logic with this code?</p>