jargon

Frontend & browser·Storage and platform APIs

you checked whether the API existed rather than checking which browser you were in.

Feature detection

Also calledcapability detection, @supports

Testing for the presence of a capability before using it, with `in`, a truthiness check, or `@supports` in CSS. It is the durable alternative to user-agent sniffing, which breaks whenever a browser changes its string or a new one appears. The failure mode to watch for is a partial or buggy implementation that passes the check, which is exactly what a badly written polyfill also creates.

Commonly confused with