Hope you don’t mind me chip in a little. It’s great to know that there is some tinkering done with the lesson’s code to make some variation of it, it shows that you’re enthusiastic to try new things and have a curious mind.
Like @stetim94 mentioned, it is always a good call and better to follow what the instructions asked in the lessons. To be precise, just copy whatever sentences or variable names those lessons asked for, all that is done to avoid the frustration of not passing the lessons due to different spelling, spaces or capitalization (You might be surprise some hurdles was due to spelling differences like
favorite, which caught some users off-guard). By doing all that, if you encounter not passing lessons, you can eliminate those errors above and start debugging your code to see where it might be coded wrongly, it will save some time for you in future.
That said, if you’re considering about tinkering those code you have in your lessons, you can copy the code and paste it into a site like repl.it to change and play with the variations you like and see if those changes you make will be working or not.
Small suggestion and opinion:
In the current state,
.toLowerCase() does nothing in your code. Since you already assigned
full in all small-caps to variable
var moonPhase = 'full';
(It’s a bit redundant to test for lower case again using
.toLowerCase(), I guess that’s why the author of the lesson omitted it)
However, you can consider adding a
prompt in the code to trigger for user input, then,
.toLowerCase() could prove its usefulness as user might type in something like
Nonetheless, all these opinions are only for your side-project outside of CC learning environment. During the learning lesson in CC, just stick to what is instructed and follow those instructions accordingly. You will progress with less hurdle that way.