jeudi 24 octobre 2019

How can I access properties (such as variables or objects) of an anonymous self-invoking function with a console?

I have a website with the following code:

(function() {
    var x = "Welcome!";
    var o = {"date": Date.now(), "elapsed": null};
})();

Is it possible to access the variables x and o (such as logging their value) from a browser console? If so, how?




Aucun commentaire:

Enregistrer un commentaire