1

If a page has code that wraps all variables in a scope, like this:

$(function() {
    var attempts = 3;
});

Is it possible to edit the variables inside that scope from the browser console (eg Developer Tools for Chrome or Firebug for Firefox)?

1
  • No, You can change the html output and see the result. But you already know that it doesn't change the source. You can try it in debug mood Commented Oct 31, 2012 at 7:01

1 Answer 1

1

Yes, just set a breakpoint. Upon reaching the breakpoint you can modify all variables that are in scope at the breakpoint - including those hidden within closures.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.