Draw Method not Called

How can the draw method be used in Cococs2d JavaScript?

In a Layer:
var HelloWorldLayer = cc.Layer.extend({ ...
There is ctor:

ctor: function() {
this._super();
this.scheduleUpdate();
... 
}

And and update:

update: function(dt) {
...
}

And draw:

draw: function(ctx) { //NOT BEING CALLED
this._super(ctx);
OR
draw: function() { //NOT BEING CALLED
this._super();
...
}

In C++ it is easy:
void WorldScene::draw(cocos2d::Renderer *renderer, const cocos2d::Mat4 &transform, uint32_t flags) { ... }

But, the draw method is not called in JavaScript. What is wrong and how to call them?

I remember reading a while ago that the draw method was not available in JavaScript because it would have an effect on performance. I’m not sure if this is true or even if it’s still valid, but that’s why I’ve never bothered worrying about it myself.

from source code :

/**
     * Render function using the canvas 2d context or WebGL context, internal usage only, please do not call this function
     * @function
     * @param {CanvasRenderingContext2D | WebGLRenderingContext} ctx The render context
     */
    draw: function (ctx) {
        // override me
        // Only use- this function to draw your staff.
        // DON'T draw your stuff outside this method
    },

But i don’t know how to solve your problem. What do you want to add inside draw function ?