solving a simple problem
It was during the javascript game exercise where we had to grab elements by their class. I was looking at the code, reading the code, making sure that all of the class names were matched, that I was using the right function, and ensuring that it was called properly. But the damn code wouldn't work. I spent a few hours googling and comparing my code, but this yeilded no results. I decided to write the code from scratch again, muting the initial non-working one. It worked!
Usually this would be a good thing, but this just confused me more because the
second code was written exactly the same as the first - @$#%@$ !!!!
After comparing the two side by side, I found the only difference was a capital
letter.
problem solving techniques
Pseudocode - I have not properly used this yet, but I understand that
it will be useful in the future and I should get into the habit.
Trying something - This is the method I use most, but I am conscious not
to spend too much time on different things and eliminate guessing -
then I'll hit google!
Rubber ducky method - I haven't tried this method yet but can already sense
some of the enlightenment that will occur when I start talking to my pencil.
Reading error messages - Becoming easier and easier. They are starting to
make more and more sense, albeit slowly. I have started googling those I don't
understand to try and get a better grasp.
Console.logging - A great way to examine the program and how it's running,
incredibly useful!
Googling - This can take a lot of time but it's immensely helpful 99% of
the time.
some array functions
.map() - changes every single item in the array with the condition
.filter() - this changes every item in the array that fits a specific
condition and filters out those that don't meet the requirements.
.reduce() - sends the condition down every item in the array and calculates
the end result into a single value.