How to access javascript variable stored in function closure from browser console?
Lets say I have a global function: function Init() { var v = 10; window.GlobalFunction = function() { // Global Function has access to v, because of closure alert(v); } } Init(); How I can get value of v from FireBug console? I can put break point there and see value. However this is not enough for me. I want to build FireFox addon for third party website, so I need access this variable, but can't change source code. If v is a global variable like you say, then you should just be able to type v at the console to get its value. If v is not a global, then you can only access it from within the