Here is my JavaScript code so far:
var linkElement = document.getElementById(\"BackButton\"); var loc_array = document.location.href.split(\'/\'); var newT =
To prevent removing last item from origin array you could use
Array.from(myArray).pop()
Mostly supported of all browsers (ES6)