How to get domain name from URL in JavaScript | i2tutorials

How to get domain name from URL in JavaScript | i2tutorials