Trouble in looping using javascript closures and addEventListener in a chrome extension

I am working on a chrome extension and need to loop through an array. I know there are a lot of questions answered regarding js closures, and I did changes accordingly too but my objective fails yet. I want to add an eventListener for every element of the array. It doesn’t work even after using let to define variables.

 function foo(array){
   for(let j=0; j

In case of arrays which have more than one element, the function makeItHappen works only for the last element. On clicking on the element with id2, in case of the last element of the array, chrome.tabs.create({ url: presentUrl }) creates tab corresponding to all the elements, including even the elements, other than the last element. Whereas on clicking on the element with id2 corresponding to the other elements, other than the last element, there's no action, no tab generated, even change function is also not called.

Why am i not able to see “Closure” in chrome dev tool?

BTW this is the chunk i have used to check:

function outerFunction () {
  const outer = `I see the outer variable!`
  function innerFunction() {
    console.log(outer)
  }
  return innerFunction
}
outerFunction()();

Do i need to enable something in settings or any extension is required or whatever. Any help would be appreciated.