Earlier this week I got blocked on a problem while researching JavaScript methods.
One of the methods I was researching was a math function. I wanted to show an example of an exponential
math function method, and I could do the code fine but I couldn't for the life of me understand what the
heck exponents can be used for as a real life example.
I felt super frustrated, looked on Google, asked friends,
and nothing was sinking in. I went to take a break and fell asleep straight away. So the takeaway here is that
if something seems way harder than it should be, you probably need a break.
I was pretty pleased with the roll that I was on for the deBee challenge this week.
The challenge was to take a sentence and use JavaScript commands to remove any buzzy words.
There was a bit of spelling and case variation in the words: "buzz", "BuZz", "bizz" etc.
I've caught myself not reading the questions properly about three or four times now so
this time I looked pretty hard at the question. First, I split the string into individual words, then
I made all the words lower case so the buzzing would be easier to filter out. The next hurdle we had to
go over was to filter out the word "bizz" as well - as just filtering out "buzz" would leave "bizz".
I considered filtering words that start with "b" but there were other words ("by" and "bees")
that would have fallen under that category too. I'd seen the "startsWith()" method before,
so I thought I'd see if "endsWith('zz')" would work - and it did! :D
Putting brackets around the instructions in the filter command meant it kept words that did not end in 'zz'
and it also put all the words that end in 'zz' into lower case. All the buzzing was gone, and all that was
left was to join the string back together. Noice.