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)?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.