Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Database 10g Insider Solutions

Authors: Arun R. Kumar, John Kanagaraj, Richard Stroupe

1st Edition

0672327910, 978-0672327919

More Books

Students also viewed these Databases questions

Question

What is Aufbau's rule explain with example?

Answered: 1 week ago

Question

Write Hund's rule?

Answered: 1 week ago

Question

1. Who should participate and how will participants be recruited?

Answered: 1 week ago