JSFiddle - React, Tailwind, and code Playground

JavaScript

function Ch() {
    this.year = function (n) {
        return n
    }
}

function Pant() {
    this.name = 'Kelli';
    this.year = function (n) {
        return 5 + n
    }
}

Pant.prototype = new Ch();
Pant.prototype.constructor = Pant;
pant = new Pant();
alert(pant.name); //Kelli
alert(pant.year(5)) //10

// Is the below what you need?
alert(Pant.prototype.year(5)); // 5