Use NodeJS v10 to run code.
Run npm install
to install dependencies.
Run npm test
for tests.
For more functional approach getChangeFor
will return object
{
result: [] // list of coins
inventory: {} // new inventory without resulted coins
}