Exploring javascript's prototypical inheritance and object-oriented programming is new to me. I attempted to create a base object called Account and then inherit the CheckingAccount from it. Below is my code snippet.
function Account(fName, lName) {
this.firstName = fName;
this.lastName = lName;
}
Account.prototype.balance = function() {
console.log("This is the balance");
}
function CheckingAccount() {
this.salary = 10000;
}
CheckingAccount.prototype = Object.create(Account.prototype);
let account = new Account("John", "Doe");
let checking = new CheckingAccount();
CheckingAccount.balance();
Upon running this in Visual Studio, an error message pops up: "Uncaught TypeError: CheckingAccount.balance is not a function". Any guidance on resolving this issue would be highly appreciated.