I tried to do that like as:
const int = Number(this.getCurrentYear());
It return me string current year
I tried to do that like as:
const int = Number(this.getCurrentYear());
It return me string current year
You must parse it to an int
var numberAsString = "4566";
var numberAsInt = parseInt(numberAsString);
so change your code to this
const int = parseInt(this.getCurrentYear());
if this doesnt work either this.getCurrentYear() must not be a number(its either undefined or contains alphabets or symbols)