Media Query vs Javascript widths

document.documentElement.clientWidth

Window width here

document.body.clientWidth

Body width here

window.innerWidth

Body width here

Media Query:

@media (max-width: 800px) {
  .media-query {
    background-color: red;
  }
}
Media Query affected at 800px