Call JS Function inside an Object
<p>I am new to OO in JavaScript and trying to make this simple canvas demo:</p>

<pre><code>var c; // typeof c is the canvas element
function SolarSystem(plane, sun) {

    this.plane = plane; // typeof plane is Canvas Ctxt
    this.sun = sun;

    this.init = function () {
        draw();
    }


    this.render = function () {
        c.height = c.height;
        requestAnimationFrame(this.render);
        this.draw();
    }

    this.draw = function () {
        console.log(1);
    }

}
</code></pre>

<p>What I want to do is, to render <code>SolarSystem</code>, I want to call render() that is inside of it. I cannot call render() from render(), how can I do that without getting <code>Uncaught TypeError: Type error</code> in the console? Thanks!</p>
