Is there a better way to do this using chaining?
var url = "www.mycompany.com/sites/demo/t1"
var x = url.split('/');
console.log(x);
var y = x.pop();
console.log(y,x);
var z = x.join("/");
console.log(z);
I tried something like but wouldn't work since pop just returns the last value and not the rest:
parentUrl = self.attr('Url').split("/").pop().join("/");