let/var declared inside of a self invoking function go away outside of it. consts remain. So if you want it to disappear, use var/let. If you want it to stay, const or nothing
var x = "AAAAAAA333AA";
(function (a) {
console.log(a);
}(x));
/*x must be already defined at the time*/