Let’s look at how to get the height and width of the viewport using Vanilla JS. We can use window.innerHeight to…