We do it on our site to determine the layout of a map-based page.
Matthew Gifford

Matthew Gifford, I have found this on SO: http://stackoverflow.com/a/16567475/2075782

This it’s supposed to be an example where you can use CSS3 Media Queries on JavaScript.

What do you think more elegant and reliable than compare Width and Height?
In last resort, these Media Queries, compare the Width with the Height or something like that…