The orientation read-only property of the Screen interface returns the current orientation of the screen.
orientation
MDN Reference