How to get port from url in JavaScript

URL
Last updated Apr 28, 2018
window.location.port;