Is there a way to make this function not create a global variable while the body is still just an expression on one line (after return).
Seems like if it works with making a global, should be a way to do it with a local
getHashKeyValues = function(h){
return p={},h.replace(/[\|;]+([^=;]+)=([^;]*)/gi,function(s,k,v){p[k]=v}),p
}
console.log(getHashKeyValues("#/app/path|key1=value1;key2=value2"))