Confirming ES5 support

Viewed 5959

What are the best and simplest ways, in a Javascript (CoffeeScript) front-end application, to notify a user their browser is not supported, rather than letting it fail over unsupported ES5 features when they are randomly hit by the user? Say, I am writing something for only modern browsers, and I'd like to avoid a myriad of failures that old browsers would bump into wherever my code uses ES5-introduced features... by blocking non-compliant ES5 browsers?

ES5 introduced some syntax features, some of which I believe CoffeeScript relies on, and I would like my code to somehow avoid executing to begin with, if the browser does not support ES5, rather than tweaking shims, using Modernizr, or checking each CoffeeScript syntax subset to figure how backwards is it supported. Just ES5 and a clean "we're sorry your browser is too old" page for the rest of the world.

I do not wish to write code that tests every ES5 feature, nor necessarily rely on compliance tables such as http://kangax.github.io/es5-compat-table/ for checking the browser type and version (although, I would resort to the later, if no nicer alternatives...).

3 Answers
Related