javascript get user screen resolution code example
Example: html get user screen resolution
function getResolution() {
const realWidth = window.screen.width * window.devicePixelRatio;
const realHeight = window.screen.height * window.devicePixelRatio;
console.log(`Your screen resolution is: ${realWidth} x ${realHeight}`);
}
// test
getResolution();
// Your screen resolution is: 3840 x 2160