Day 17 of 21 Days of Javascript
I completed chapter 7 and it has to be the most confusing chapter of Eloquent Javascript so far. It jumps across concepts relatively quickly, assuming a firmer grasp than beginners might have.
For example, I couldn't complete the bonus exercise on data structures, right after the robot sim. The solution is very simple, in retrospect, but it requires a firm understanding of static properties (values that live on the class, not the instance of it) and the quirks of how constructors work.
On constructors specifically, the exercise asks that a constructor shouldn't be part of a class's interface for the task at hand. However, JavaScript does not have a way to make the constructor inaccessible. Every class either has a constructor you give it explicitly, or one the language provides by default.
Turns out, the exercise wants the reader to provide a different entry point to creating a new object. This is an API design choice of sorts. Instead of writing "new ClassName(...)", it wants the reader to use "ClassName.empty". It's probably just me but I found this confusing.
In the interests of time (I want to learn the syntax of the language fast) I gave up on this exercise and just read the solution. I want to avoid skipping exercises. But I also have just 4 days left of this challenge so something has to give.