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
Creating a Class Solution
Solution
Your first code challenge in the Practices Classes in JavaScript practice session asked you to create a class called User and not add a constructor method to it.
A class declaration is short and simple.
class User {
}
The class declaration starts with the keyword class
. Then the name of the class, which is capitalized, is added, followed by a s...