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
Instantiating an Object Solution
Solution
In this code challenge, your job was to create a new instance of the User class and store it inside a variable called user1
.
The variable could be declared with any of the variable declaration keywords var
, const
, or let
. We’ll use const
, but the code is valid regardless of your choice.
New instances of classes are created with the keyword new
followed by the n...