The matchMedia() method is used to return a MediaQueryList with the results from the query. The media queries of the matchMedia() method is any media features of the CSS @media rule. It may include min-height, max-height, etc.
Its syntax is:- window.matchMedia(mediaQuery)
Its return is:- MediaQueryList object with the results of the media query
|mediaQuery||Required. A string representing a media query.|