Eating Prunes
Getting blocked is an easy thing to do. Like breathing it is a natural part of a coding ecosystem. One recurring problem I encountered was not understanding particular words within the JavaScript lexicon [like addEventListener]; then searching for as many iterations and applications of that word. Google is my first go to point as it makes me feel I'm capable of discerning the answer. Sometimes though there is just too much info requiring specificity that it becomes overwhelming, then discouraging, that quickly becomes frustration resulting in blockage. Only later did I realise that I should've used Dev Tools to inspect the code to see how others were using addEventListener and seeing it in ctx|context cemented it's application. I've learned that code is sometimes better when you've got examples of code that illustrate it's function and implementation. And that if we need help - our peers would come to our assistance which was an awesome thing to have and see - especially with problematic error messages [validated & solved via jsBin].
Something of a more 'eloquent' approach was trying to figure out how to get my character|racecar to move. Seeing how many others used tables and the value "active" forced me to think - are we really restricted to just tables? Of all my peers, there was one who didn't rely on a table, but created an "arena" where his characters could move. After pseudocoding up my thoughts, I was surprised after inspecting their code to discover that they used three distinct code blocks, each wrapped in a function. The complexity and ingenuity of the coder told me that I could indeed learn alot from them. I deliberately broke the code apart, changed it then waited to see how the browser would react to my changes, and quickly learned the functionality and output of the code. Yes, I was challenging myself to understand what was happening by unravelling code, but learned so much that I adapted some of that thinking - and since it was a racing game, themed my racer accodingly. I learned that I'm really confident with HTML & CSS and having prunes like JavaScript along the way keeps things varied too. Upon reflection, I need to be more open to engaging our coaches for their wisdom and experience and maybe then I will achieve things in a more timely fashion.
var whatIs = [".map()",".filter()",".reduce()"];
.map() is a method applied to a list||array by defining a function for it to perform upon aforementioned list||array. If for example we had a bucket (array) of different coloured pegs (numbers || integers) yet I wanted them to be all pink. .map() would take all the different coloured pegs and perform the function of making them all pink.
.filter() as it's name suggests is used to create a new array by filtering elements and allowing only those that pass the test performed by the function command. .filter() could be considered like a selection process. Similarly, the function of Phase-0 tests to see whether a cohort of people will make it to Phase-1||Bootcamp.
.reduce() is used to reduce a list||array of values to just one value. Say we had a garage sale and had heaps of items (variable 2) up for sale. Our goal is to raise enough funds (variable 1) to go overseas. By reducing||selling (variable 2), we reduce down and end up with one value (variable 1) which are our total funds.