We're a place where coders share, stay up-to-date and grow their careers.
Oneline with javascript
const domainName = d => new URL(d).hostname.split(".").shift()
Oneline with javascript