Please run the file with the node.js commands
eg
node section1_question1
Sum of the digits in 100! is 60
Here I have chosen to store the instances in a javascript Map because:
- The keys can be any primitive type. In this case the Key is the id of the account, which is an integer.
- Elements in this data structure can be ordered.
- Flexibility as there are default methods like
has()
,values()
,delete()
- Highly efficient for search and moderately efficient for insertion
- Records are accessible by unique account number (sometimes called an exact-match query).
Here I created instances of DevAccounts, which are capable of transferring to each other.