Skip to content

Instantly share code, notes, and snippets.

@chris-sev
Last active November 27, 2018 01:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chris-sev/b055d60ad8e0719501f71dfece728fd2 to your computer and use it in GitHub Desktop.
Save chris-sev/b055d60ad8e0719501f71dfece728fd2 to your computer and use it in GitHub Desktop.
Replace http with https
// 1. we have a url
const url = "http://scotch.io";
// 2. replace http: with https:
const httpsUrl = url.replace("http:", "https:");
// 3. output: https://scotch.io
console.log(httpsUrl);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment