Question
I want a member function made in typescript that takes in a year from an arraylist (between 2014-2019) adds 3 to it, and then compares
I want a member function made in typescript that takes in a year from an arraylist (between 2014-2019) adds 3 to it, and then compares it to the time left to reach the current year. IE: if I used 2015 it would return -3. 2015+3 = 2018. The current year is 2021. 2018-2021 = -3. If I used 2019 then it would return 1. I dont need an arraylist made I have one. I will provide one for an example to be used.
differenceinyears() {
//code here
}
var yearList = []; var compareyear= { "year": "2015" }; yearList.push(compareyear);
console.log(yearList[i].differenceinyears); //this should output the year difference.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started