Trying to add a number new date in javascript
How ever the number is coming in from a json file.
Here is what i have.
myObj = {"yearsleft":"2", "name": "john"};
var term = myObj.yearsleft;
var d = new Date();
var year = d.getFullYear() + term.toString();
var month = d.getMonth()+1;
var day = d.getDate();
var output = ''+ (day<10 ? '0' : '') + day + '/' + (month<10 ? '0' : '') + month + '/' + year;
alert(output);
above is a working example
However its just appending 2 to the end of the year. which isnt what i want it to do. I want it to add onto 2019 if that's possible.