Bummer! This is just a preview. You need to be signed in with an account to view the entire instruction.
- Practicing Classes 0:40
- Practice Creating a Class 1 objective
- Creating a Class Solution
- Practice Writing a Constructor Method 1 objective
- Writing a Constructor Method Solution
- Practice Instantiating an Object 1 objective
- Instantiating an Object Solution
- Practice Adding Methods 2 objectives
- Adding Methods Solution
Instruction
Adding Methods Solution
Solution Task 1
This was a two task code challenge. In the first task you were asked to add a method to the User class called changeUsername()
. This method should receive one parameter, representing the new username. It shouldn’t return anything. The object of the method is to change the value of the username property.
class User {
constructor(email, username, bi...