Today's Progress: I continued working Intermediate Algorithm Scripting challenges on freeCodeCamp; 48% complete.
I also published the blog post about regular expressions that I had written yesterday.
Thoughts: Today's session was brief, but I learned two key things: (1) the for...of
loop makes certain iterative steps easier, and (2) the logical not !
can be used inside an if
statement.
I stumbled upon the for...of
loop while watching a tutorial video about the solution to a challenge on freeCodeCamp. I was stuck on the challenge and had tried a few different variations of the logical statement and my for
loop but couldn't get it to work (even though when I tested the pieces of it with console.log()
which should the individual pieces worked, but not the whole). Thankfully, the suggestion in the tutorial help solve that problem.
After consulting the documentation for the for...of
loop I found that this type of loop is quite useful for iterative processes. Especially in this challenge where I had to check each item within a series of arrays. After tweaking my initial, ordinary for
loop to become a for...of
loop, it made the solution more simple.
Further, the tutorial also talked about the using the logical not !
inside an if
statement - which seems obvious to me now, but before I didn't think that was possible. I had assumed that you needed to using something like if ( /* condition */ === false)
in order to get the negated version (or the equivalent statement if ( /* condition */ !=== true)
). Discovering this was both helpful solving the challenge, but also helpful for future challenges (I wish I had known it for some previous challenges).
I would have liked to have studied further, but unfortunately my study session got interrupted by a flood evacuation for my apartment. Thankfully, my partner and I (and our valuable belongings) are safe, but that meant least time for studying. However, sometimes there are more important things than studying.
Study Music: Battlestar Galactica's Prelude to War by Bear McCreary
References:
Link to work: freeCodeCamp Timeline