Example: Get Dimensions of an Image
Output
width 1040 height 922
In the above program, new Image() constructor is used to create an image object.
The Image() constructor creates a new image element instance.
img.src is then used to add the image using an image URL source.
The img.onload() function is used to access the height and width of the image.