Created
October 2, 2017 08:13
-
-
Save Expl4Life/cd9b0d69423db5949c5e560a542e3fc9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const getSlugName = () => { | |
let url = window.location.href; | |
let matches = url.match(/\d+$/); | |
if(matches) { | |
let slugName = Number(matches[0]); | |
return slugName; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment