Skip to content

Instantly share code, notes, and snippets.

@jayboss222
Created November 18, 2016 00:03
Show Gist options
  • Save jayboss222/e3d4fa073bab6c3736e70246c87721b1 to your computer and use it in GitHub Desktop.
Save jayboss222/e3d4fa073bab6c3736e70246c87721b1 to your computer and use it in GitHub Desktop.
var path = (function() {
var pathName = window.location.pathname;
var newPathArray = pathName.split('/').filter(function(val){
return !val == '';
});
function partExists(arrVal) {
return newPathArray.some(function(val){
return val === arrVal;
});
}
return {
parts: newPathArray,
partExists: partExists
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment