Question: I'm a beginner in jQuery, I learned and write code in this style from a document, I want to see the data in that scope when I use chrome console,but I can't.I want to use some tools or code to get that variable.

```
(function($){
    $(function(){
        var a = 1;
        //code
        //'that' is this scope
    })
})(jQuery);

```

Answer: 
There are two ways to see the value of `a` on the Chrome console:

1. Use the debugger built into Chrome to set a breakpoint on any line of code in that inner function. When the breakpoint is hit, code in the console is run within the scope of the code at the breakpoint, so you could use the console to inspect `a`. (Or you could just hover over `a` in the source window to see its value.)
2. Add a line of code to the function: `console.log(a)`. But I recommend using the debugger instead.
T.J. Crowder's answer actually provides a good solution, here I would like to add the use of `debugger` statement which invokes any available debugging functionality (similarly on settings a breakpoint in your code).

If no debugging functionality is available or your browser dev tools are closed, this statement has no effect.

```
   (function($){
        $(function(){
           debugger
            var a = 1;
            //code
            //'that' is this scope
        })
    })(jQuery);

```

To learn more about debbuggin in chrome:

<https://developer.chrome.com/devtools>

More on `debugger`:

<https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Statements/debugger>