JSFiddle - React, Tailwind, and code Playground

JavaScript

function MakeAsSubclass (parent, child)
{
	child.prototype = new parent;	// No constructor arguments possible at this point.
	child.prototype.baseClass = parent.prototype.constructor;
	child.prototype.constructor = child;

	child.prototype.parent = child.prototype; // For the 2nd way of calling MethodB.
}

function Parent (inVar)
{
	var parentVar = inVar;

	this.MethodA = function () {console.log("Parent's MethodA sees parent's local variable:", parentVar);};
	this.MethodB = function () {console.log("Parent's MethodB doesn't see parent's local variable:", parentVar);};
}

function Child (inVar)
{
	Child.prototype.baseClass.apply(this, arguments);

	this.MethodB = function ()
	{
		console.log("Child's method start");
		Child.prototype.MethodB.apply(this, arguments); // 1st way
		this.parent.MethodB.apply(this, arguments); // 2 2nd way
		console.log("Child's method end");
	};
}

MakeAsSubclass(Parent, Child);

var child = new Child(7);
child.MethodA();
child.MethodB();