r/javascript • • Aug 21 '18

Effectively supported in all browsers, JavaScript has its own form of media queries just like CSS.

https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia
465 Upvotes

114 comments sorted by

View all comments

Show parent comments

0

u/[deleted] Aug 22 '18

[deleted]

-4

u/esr360 Aug 22 '18

The same is true of any API. You can't guarantee that any API will never become deprecated or obsolete. You just have to ask yourself if it's likely. To me it seems very likely that this API will work as-is for the next few years at least, and if I had any genuine concerns I would use a polyfill.

0

u/[deleted] Aug 22 '18

[deleted]

1

u/AndrewGreenh Aug 22 '18

This is not part of ECMAScript, this belongs to browser APIs.