Coding Challenge: Modeling a Bank Account

Let's create an object of Bank Account and implement some of its methods.

We'll cover the following

Problem statement

Create a Bank Account object with the following properties and methods:

  • A name property is set to “Alex”.
  • A balance property is set to 0.
  • A credit() method adding the (positive or negative) value passed as an argument to the account balance.
  • A describe() method returning the account description.

Try to solve it on your own and if you get stuck anywhere, you can always refer to the solution.

Coding exercise

Get hands-on with 1400+ tech skills courses.