Solution to JavaScript Domain Extracting Exercise