Question: lick() is a private method of Cat. Unfortunately, Cat's this.paw is not accessible in lick(). Is there a simple way to create a private method that has access to the member variables of its containing class?

```
<!doctype html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<p id="catStatus">???</p>
<script>
function Cat() {

    this.paw;

    var lick = function() {
        alert(this.paw);
        if(this.paw == "sticky") {
            alert("meow");
            document.getElementById("catStatus").innerHTML = "*Slurp*";
        }
    };

    this.beCat = function() {
        this.paw = "sticky";
        lick();
    }
}
var kitty = new Cat();
kitty.beCat();
</script>
</body>
</html>

```

![Result](https://i.stack.imgur.com/cIpgr.png)

Answer: 
The value of `this` depends on how you call the method.  

Since you're not calling the method on the object instance, `this` becomes the global object.

Instead, you need to save `this` in a variable:

```
function Cat() {
    this.paw = ...;

    var me = this;

    var lick = function() {
        alert(me.paw);
        if(me.paw == "sticky") {
            alert("meow");
            document.getElementById("catStatus").innerHTML = "*Slurp*";
        }
    };

    this.beCat = function() {
        this.paw = "sticky";
        lick();
    }
}

```
The context of this depends upon who called the function. In this case it is beCat. You can however explicitly specify the this scope by using call. 

In your case:

```
    this.beCat = function () {
        this.paw = "sticky";
        lick.call(this);
    }

```

Or you can store the this in a variable. 

You can read more about the this scope/how it works [here](http://unschooled.org/2012/03/understanding-javascript-this/).