When a certain amount is entered, the code should be capable of handling figures up to 20000. For instance, if the input amount is 2600 with a card balance of 3000, the output will be as follows: New Balance - 400 Notes: 2000 * 1 500 * 1 100 * 1
Only three banknotes are allowed: 2000, 500, and 100, and there is a cash limit of 20000.
I am relatively new to the world of JavaScript and struggling to write the necessary code. Can someone please assist me?
var h = 5;
var f = 2;
var t = 1;
// More code snippets here...
Apologies for the simple program, but I would greatly appreciate if someone could provide a solution in TypeScript code, returning the required denomination in an array. Thank you!