at the moment I am learning JS from MDN docs.
the problem that I face is that I always should check where I am by checking the page link by the links in the left navigation. (I know I can use the breadcrumb but I want to know where I am in the tree).
as I am a newbie and maybe it happens for others too, I thought it would be good if I share my solution with you and if I got positive feedback then I can open a feature request.
I have to admit that I am not a native English speaker.
I read the rules before posting but I hope I follow the rules.
my proposal :
`// select the left menu
var leftNav = document.getElementById(“quick-links”);
// Links in the leftNav
var links = leftNav.querySelectorAll(‘a’);
// Colorise or whatever to distinguish where am I
var findMyLocation = false;
for (var i = 0 ; i < links.length ; i++){
if (links[i].href.toString().includes(document.location.pathname)){
links[i].style = “color:yellow;font-size:24px”;
findMyLocation = true;
}
}
if(findMyLocation)
console.log("I find where am I");
else
alert("Unfortunately, I can not find my place");`