Discussion on JavaScript Async/Await Syntax and Implementing Floating Interest Rates in Financial Calculations

The State Changers' meeting primarily focused on discussions about JavaScript and interest rate calculations. Participants compared the implementation and readability of 'await' versus 'then' in JavaScript. They advocated for the use of 'await' as it makes syntax clearer and suggested adding 'replace references to then with async await' in programming prompts.


A significant portion of the discussion centered around handling fixed versus floating interest rates. The main problem was calculating interest on a period basis while taking into consideration the sub-periods for interest payments based on floating rates. The State Changers proposed a solution of dividing the input rate by 3 (for a quarter) to get the monthly rate. They suggested creating an array with interest rates for each sub-period by performing these calculations. This approach involves using a 'for each' loop for each quarter, then adding one third of the total quarterly amount to an output array within a 'for loop' for each month of the quarter. They pointed out that since the number of iterations is known (three times), there's no need to create a loop, and sequential static additions could make the code easier to read. State Changers were aware of the growing complexity and dynamism of operations when dealing with more complicated financial calculations, such as accounting for floating interest rates. They highlighted the importance of maintaining simplicity in some aspects of the code to keep it readable and understandable amidst other complex aspects. Conversations within the meeting could be valuable to developers or financial analysts looking to implement or understand complex financial calculations using JavaScript.


(Source: Office Hours 9/19/2023 )

State Change Members Can View The Video Here
chris-montgomery-smgTvepind4-unsplash.jpg

View This Video Now

Join State Change Risk-Free