JSFiddle - React, Tailwind, and code Playground

by Abhishek Kumar

JavaScript

var a = document.createElement('a');
a.href = window.location.href;

['href', 'protocol', 'host', 'hostname', 'port', 'pathname', 'search', 'hash'].forEach(function(k) {
  console.log(k + ':', a[k]);
});