ARTICLE AD BOX
I can see many issues in your code. First, let me show the correct syntax:
This is only one of the possible solutions. Please see the comments to the relevant code lines.
Note that #ideas is a priavate member. This is a new class feature. You can read about private members in JavaScript classes. Hiding some implementation objects is important enough. In the code snippet shown, the array object ideas is exposed only via the functions pin and unpin, and the length is exposes via the read-only property count. This way, the user cannot accidentally assign ideas to null or to the object of a wrong type.
Now, please understand how an instance function is called. Let's look at the call in the test:
board.pin(idea);Here, the instance of the class ProjectIdeaBoard implementing pin is board. This is actually a hidden function argument passed to it and acceptable in the implementation of а function as this. If this is not used, there is no need to use function, because in this case, an arrow function can be used instead.
Pay attention for the property getter syntax using the keyword get. For the setter, the keyboard is set, and the function should accept one argument to be assigned when the property is assigned to a value.
