var strings1 = ("https://www.letsgodeep.com/deep/deeper/deepest/").split('/')
var strings2 = ("https://www.letsgodeep.com/deep/deeper/deepest/bottom").split('/')
console.log(Object.keys(strings1).length)
console.log(Object.keys(strings2).length)
Both of these return 7. I'm assuming it's because string 2 doesn't end with '/' but that will usually be the case. I can't figure out an easy way to tell if I have string1 or string2. Everything up to and including 'deeper' is always the same value.
UPDATE: Thanks for the help. JD's answer was a good idea but hngr18's solution worked out for what I need. (double check that we're on the right path && if length is greater than 6 we're at the 'bottom')
if ((location.href).split('/')[3] == 'deep' && Array.from(new Set(location.href.split('/'))).length > 6)