The first official week was all about vanilla Javascript featuring: loops, arrays, functions and objects. It was a steep climb, not only learning all of this but in the practice of immediately applying it in tough challenges. At week's end, we received a daunting task, one that is revered by the GA alumni. MTA
This task involved utilising all of what we learned to calculate a trip on the MTA in NYC. You can see how I did it here
This task involved utilising all of what we learned to calculate a trip on the MTA in NYC. You can see how I did it here
// // An idea for the direction was to use the +/- sign as a way to demonstrate direction | // // If the number of stops is negative, then it should move right to left and vice versa | // // if it is a postive number. I ended up using > < to determine the index position instead. | // | // Now to integrate the other 2 lines. The complex nature of this is that although Union Square | // acts as a hub for all 3, the lines do not mirror each other exactly. | // | // First part is to put the arrays into an object | // If startLoc is in nLine && endLoc is in sixLine then | | const subwayLines = { | nLine: ["times square", "34th", "28th", "23rd", "union square", "8th"], | lLine: ["8th", "6th", "union square", "3rd", "1st"], | sixLine: ["grand central", "33rd", "28th", "23rd", "union square", "astor place"] | }; // object subwayLines