Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

extract domain from url js

const url = 'http://www.youtube.com/watch?v=ClkQA2Lb_iE';
const { hostname } = new URL(url);

console.assert(hostname === 'www.youtube.com'); // true
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #extract #domain #url #js
ADD COMMENT
Topic
Name
5+4 =