remove double slash from url javascript

JavaScript
abc.replace(/([^:]\/)\/+/g, "$1");
Source

Also in JavaScript: