**** throw error: this.getUnit is not a function****
function ConvertHandler(initialString) {
this.inputUnit = this.getUnit(initialString);
this.inputNum = this.getNum(initialString);
this.returnedUnit = this.getReturnUnit(this.inputUnit);
this.returnedNum = this.convert();
this.getNum = function (input) {
return input.match(/((\d*\.?\d+)*(\/?)(\d*\.?\d+))/igm);
};
this.getUnit = function (input) {
//let result;
//input req.query.input
return input.match(/[A-Za-z]+$/i);
};
**........**
}
var a = new ConvertHandler('4mi');
console.log(a.spellOutUnit());
** I can’t assign object function return value to object property, can anyone help? **