Q:

How to call key of object inside of object without "this"

I started using Base.js for a class inheritance. In Base.js a class should be an object, but does not function.
This creates a problem:
    ​var obj = {
    variable:true,
        func:function(){
            console.log(variable);
        }
    };

    obj.func();​

This code throw error: "Uncaught ReferenceError: variable is not defined". This is because "console.log(variable);" does not have "this".
But i dont want write "this" in ALL functions in my large class.
Is there any way around this?

A:

You can always write one line of extra code: var ins_obj = this; but you would still have to put ins_obj.variable in the console.log. Any language i have used does these things like this. this.variable is the way to call variables, functions inside an object.

