window.matchMedia('(max-height: 150px)') .addListener(console.log)
As a response, you get a
MediaQueryListEvent which, in addition to including the original media query string, contains a property named
matches which specifies whether or not the media query applies to the current page.
See the MDN Docs for more info.