This is a syntax error. You can only use this with template literals. So you’ll want to add backticks around this expression.
As for the incrementing of eggCount in the layAnEgg method, should it return the number of eggs before the hen lays an egg or the number of eggs after the hen lays an egg. I would read up on the increment operator a little more.
Are you sure about this? Can you explain the difference between postfix and prefix increment. Are you testing your code? When you call layAnEgg for the first time, how many eggs does it return with postfix? How about with prefix?
Update: The reason prefix/postfix is important is because you are doing the incrementing in the return statement. If you did the incrementing first, outside of the return statement, then it wouldn’t matter.
I think this is probably something you can debug and figure out for yourself.
If layAnEgg() should return the string “EGG” then why are you returning this.eggCount? Shouldn’t you just be returning the string “EGG”? So pull this.eggCount++ out of the return statement onto a line of its own. In this case, it doesn’t matter whether you use the prefix or postfix increment because what you are returning doesn’t depend on the value of this.eggCount.