Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const debit = (account, amount) => {
- if(amount > account.balance + account.limit){
- throw "Insufficient funds error";
- }
- return {...account, balance: account.balance - amount};
- }
- module.exports = debit;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement