Yes, but you don't have the overhead of constructing URL first. The new URL.canParse method from the article covers this.