title: the best way to detect browser in js
body: <p>There are lots of ways for browser detecting in JavaScript.</p>
  
  <p>As far as i know, using <code>navigator.userAgent</code> or detecting features (like <code>XMLHttpRequest</code>) and so on.</p>
  
  <p>Can anybody tell me which way is the best and most effective?</p>