You could also cache this result instead of calling the function every time. Or use Modernizr.