JSFiddle - React, Tailwind, and code Playground

JavaScript

var objB = function (name) {
    this.name = 'test'
}

var objA = function (name) {
    var obj = this;
    this.name = name;
}

objA.prototype = new objB();

var a = ['A', 'B', 'C', 'D']

for (var i = 0; i < a.length; i++) {
    console.log(new objA(a[i]))
}