Window dimensions in JavaScript

The following properties contain the dimensions of the browser window that don't include the scrollbar:

javascriptlet w = document.documentElement.clientWidth;  // a width
let h = document.documentElement.clientHeight; // a height

The following properties include the scrollbar:

javascriptlet w = window.innerWidth;  // a width
let h = window.innerHeight; // a height

The difference between the two property types gives the size of the scrollbar:

javascriptlet w1 = document.documentElement.clientWidth;
let w2 = window.innerWidth;

console.log(w2 - w1);
Задание 1

On button click, display the width and height of the window.

Задание 2

On button click, check if the window has vertical scrolling.

Задание 3

On button click, check if the window has horizontal scrolling.