Solution Review: Counting Animals
This lesson will explain the solution to the problem in the previous lesson.
We'll cover the following...
We'll cover the following...
Solution #
Explanation #
This challenge is quite simple if you have a sound understanding of static methods and variables. Static properties are assigned to the class instead of its prototype. This is similar to assigning a property directly to a class. For example, the static method static getCount
static getCount() {
return this.count;
}
is similar to
...