makeDeposit(depositAmount) { //This algorithm updates a savings //account by adding a "depositAmount" that //is provided //We would do something like this this.balance += depositAmount }
aBankAccount.makeDeposit(1000)
makeDeposit(depositAmount) { //This algorithm updates a savings //account by adding a "depositAmount" that //is provided //We would do something like this let depositAmount = -100 this.balance += depositAmount }
changePassword(newPassword) { //This algorithm sets a new password in a UserProfile object. let newPassword = 'X' this.password = newPassword }