Build a Bank Account Management Program - Build a Bank Account Management Program

Tell us what’s happening:

please help me to pass this when I have my code in the console part I see that
SyntaxError: unknown: Unexpected token (50:0)

and my code

class BankAccount {

constructor() {

this.balance = 0;

this.transactions = \[\];

}

deposit(amount) {

if (amount <= 0) {

  return "Deposit amount must be greater than zero.";

}

this.transactions.push({ type: "deposit", amount: amount });

this.balance += amount;

return \`Successfully deposited $${amount}. New balance: $${this.balance}\`;

}

withdraw(amount) {

if (amount <= 0 || amount > this.balance) {

  return "Insufficient balance or invalid amount.";

}

this.transactions.push({ type: "withdraw", amount: amount });

this.balance -= amount;

return \`Successfully withdrew $${amount}. New balance: $${this.balance}\`;

}

checkBalance() {

return \`Current balance: $${this.balance}\`;

}

listAllDeposits() {

const deposits = this.transactions

  .filter(tx => tx.type === "deposit")

  .map(tx => tx.amount);

return \`Deposits: ${deposits.join(",")}\`;

}

listAllWithdrawals() {

const withdrawals = this.transactions

  .filter(tx => tx.type === "withdraw")

  .map(tx => tx.amount);

return \`Withdrawals: ${withdrawals.join(",")}\`;

}

}

const myAccount = new BankAccount();

myAccount.deposit(200);

myAccount.deposit(150);

myAccount.withdraw(50);

myAccount.withdraw(30);

myAccount.deposit(100);

Your browser information:

User Agent is: Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/148.0.0.0 Mobile Safari/537.36

Challenge Information:

Build a Bank Account Management Program - Build a Bank Account Management Program

GitHub Link: freeCodeCamp/curriculum/challenges/english/blocks/lab-bank-account-manager/6718d2d59337c822ecb697ff.md at main · freeCodeCamp/freeCodeCamp · GitHub

please post again your code properly formatted

There are two ways you can format your code to make it easier to read and test:

  1. After you copy/paste your code into the editor, select it by dragging your cursor over it then click the (</>) button in the toolbar to automatically wrap your code in backticks. (You can click on the animated demo image below to enlarge it.)

  1. Manually add three backticks on a new line above your code and on a new line after your code. Note that a backtick is NOT the same as a single quote('). To find the backtick key on your keyboard, see this post.

To see changes to your post as you make them, you can click the (M+) button on the toolbar to bring up the rich text editor: