Hi, I am learning JavaScript doing some simple tasks, but not quite sure why I keep getting the following error - bank-account-literal.html:44 Uncaught ReferenceError: Balance is not defined - yet I defined the balance in line 29?
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bank Account</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- linked styles -->
<link rel="stylesheet" href="#">
<!-- local styles -->
<style>
</style>
<!-- linked scripts -->
<script src="#">
</script>
<!-- local scripts -->
<script>
// js
</script>
</head>
<body>
<h1>Bank Account</h1>
<!-- async scripts -->
<script>
var person1 = {
name: 'Davidson',
Number: 6657,
Balance: 198.77
};
var account = function (name, Number, balance){
this.name = name;
this.Number = Number;
this.balance = Balance;
}
account.prototype.deposit = function(amount){
Balance + 100;
console.info(`Deposit: ${name} new balance is ${Balance}`);
}
account.prototype.withdraw = function(amount){
Balance - 50;
console.info(`Withdrawl: ${name} new balance is ${Balance}`);
}
console.log('Hello ' + name, 'your account is '+ Number, 'with an outstanding balance of ' + Balance);
</script>
</body>
</html>