how to detect if JavaScript whole number is closer to another whole number?
<p>In JavaScript, I may have a random number generated, that may be 3,123, or 3,001, or 2790, etc.. Which JavaScript method will help me out in returning a <strong>target whole integer</strong> because these values...</p>

<p>3,123, or 3,001, or 2790 are closer to 3000, rather than 4000 or 2000, or 1000.</p>

<p>Thanks for any advice.</p>
