Question: I am using Simple JavaScript Inheritance by John Resig.
I know that I can use `this` variable to share values between methods:

```
var Person = Class.extend({
  init: function(isDancing){
    this.dancing = isDancing;
  }
});

```

I would like to create a pointer to `this` so that it would not be overwriten later like:

```
$('#id').click(function() {
  // this now points to selector
});

```

How can I create let's say `that = this` pointer which would be accessible classwide?

Answer: 
You can use '.apply()'

```
var Person = Class.extend({
  init: function(isDancing){
    this.dancing = isDancing;
  },

  setDancing = function(isDancing) {
    this.dancing = isDancing;
  }
});

var p = new Person();

$('#id').click(function() {
  p.setDancing.call(p, NEWVALUE);
  // 'this' will point to 'p' in the function 'p.setDancing'
});

```
The 'this' keyword always points to the environment it was instantiated in. For example:

```
function Obj(name)
{
this.name = name;
}

var me = new Obj('myName');
var you = new Obj('yourName');

```

me.name will return 'myName' and you.name will return 'yourName'.

You can only assign a pointer to it within the environment that it was created in, if it refers to nothing inside that environment, it points the global window. when you instantiate an object of init type, the 'this' pointer will point to isDancing.