concept assumption in category javascript

This is an excerpt from Manning's book Secrets of the JavaScript Ninja, Second Edition.
Writing cross-browser, reusable code is a battle of assumptions, but by using clever detection and authoring, we can reduce the number of assumptions that we make in our code. When we make assumptions about the code that we write, we stand to encounter problems further down the road.
For example, assuming that an issue or a bug will always exist in a specific browser is a huge and dangerous assumption. Instead, testing for the problem (as we’ve done throughout this chapter) proves to be much more effective. In our coding, we should always strive to reduce the number of assumptions, effectively reducing the room for error and the probability that something is going to come back and bite us in the behind.
The most common area for making assumptions in JavaScript is in user-agent detection—specifically, analyzing the user agent provided by a browser (navigator.userAgent) and using it to make an assumption about how the browser will behave (in other words, browser detection). Unfortunately, most user-agent string analysis proves to be a superb source of future-induced errors. Assuming that a bug, issue, or proprietary feature will always be linked to a specific browser is a recipe for disaster.
But reality intervenes when it comes to minimizing assumptions: It’s virtually impossible to remove all of them. At some point, we’ll have to assume that a browser will do what it’s supposed to do. Figuring out where to strike that balance is completely up to the developer, and it’s what “separates the men from the boys,” as they say (with apologies to our female readers).