How to debug cocos2d-x js Like debug.trace() in Lua?

When i wrote cocos2d-x with lua, I can user debug.trace() to debug the function call stack.
But how to implement that In cocos2d-x js version? Please Help me!

did you mean something like this

@
try {

cc.dumpConfig();

var director = cc.Director.getInstance();
director.setDisplayStats(true);

// set FPS. the default value is 1.0/60 if you don’t call this
director.setAnimationInterval(1.0 / 60);

// create a scene. it’s an autorelease object
var mainScene = MainMenu.scene();

// run
director.runWithScene(mainScene);

} catch(e) {log(e);} <—
@