🖥️ Screen Object

Last Updated: 26th October 2025


  • The Screen Object contains information about the user’s display screen.
  • It is part of the Browser Object Model (BOM) and helps you access details like screen height, width, and color depth.

Hinglish Tip 🗣: screen object batata hai aapke monitor/mobile ki screen ke “size aur color quality” ke baare me.


🧩 Common Properties of screen

PropertyDescriptionExample
screen.widthReturns total width of the screen in pixelsscreen.width
screen.heightReturns total height of the screen in pixelsscreen.height
screen.availWidthAvailable width (excluding OS taskbar, etc.)screen.availWidth
screen.availHeightAvailable height (excluding OS taskbar, etc.)screen.availHeight
screen.colorDepthNumber of bits used to display one colorscreen.colorDepth
screen.pixelDepthNumber of bits per pixel (same as colorDepth in most browsers)screen.pixelDepth

Example

console.log("Total Width:", screen.width);
console.log("Total Height:", screen.height);
console.log("Available Width:", screen.availWidth);
console.log("Available Height:", screen.availHeight);
console.log("Color Depth:", screen.colorDepth);
console.log("Pixel Depth:", screen.pixelDepth);