Link to a parent object
Actually, it works. But I would like to know whether it is correct or
  not.


It works because you create new instance of parent and access it there:

this.a = new A( this );


The correct way (for inheritence) is to set child's prototype and constructor:

A.prototype = new B();
A.prototype.constructor = A;


For more explanation, have a look at this question.