Code for analyzing the financial records of a company. 💜
Given: a dataset composed of arrays with two fields, Date and Profit/Losses.
Task: write JavaScript code that analyzes the records to calculate each of the following:
-
The total number of months included in the dataset.
-
The net total amount of Profit/Losses over the entire period.
-
The average of the changes in Profit/Losses over the entire period.
-
The greatest increase in profits (date and amount) over the entire period.
-
The greatest decrease in profits (date and amount) over the entire period.
All data to be logged in console.
- Extra: Added HTML markup and display of data via JavaScript.
Background image by Milad Fakurian @Unsplash
Obtained information and snippets:
-
Main functions
-
Extras
Licenced under the MIT license.
Copyright © 2023 Alexandra Batrak