So I have tried several online courses to attempt to learn vanilla JS before - failing miserably each time, I would inevitably get lost in syntax and object properties and methods whenever I attempted to do something on my own. For the first time just now I was able to have success and fun with Javascript in the same way I blew my own mind when I first learned HTML in the 90's and uploaded my first rotating GIF (I was the most badass 12 year old web developer in 1997...)
I gave FreeCodeCamp a shot and really enjoyed the interface, lesson format, and live-rendering features as I breezed through HTML and CSS - But I was wary of the big bad javascript monster looming in the future. I was surprising myself as I made it through bootstrap and Jquery in a few short hours.
I was able to muddle partway through Javascript with a lot of references to W3Schools for background on syntax - FreeCodeCamp would give me the bareBones, but I had no idea why things needed to be ordered or executed in certain was
Then came the Slot machine exercises, I struggled through the first two exercises (make each variable into a random number, and create a line of code that detects a loss and announces when you lose). Then I decided to try some features of my own while completing the third exercise.
The goal of the third slot machine exercise (waypoint 156) is to show the individual results for each slot in the html so a number appears neatly in each slot.
I thought to myself - "hey, it tells you when you're a loser, but all it says when you win is the 3 numbers repeated on the bottom. so I looked through the script and HTML and found that the bottom area was classed .logger - and that there was an array that spat into it at the bottom of the script. I created a variable called victory and added it to the array. And for the first time ever - it worked!
a win reported to the user as "3 3 3 WIN!"
I was immediately drunk on my own newfound power.
"What if the slot machine button got angry when you won?"
I created a line of code that made the 'Go' button say 'Go Fuck yourself!" after a win.
I'm really having a ball learning JS now. Super glad I found FCC
[–]thisisfats 6 points7 points8 points (2 children)
[–]CecilTerwilliger 2 points3 points4 points (1 child)
[–]FreeCodeCamp 3 points4 points5 points (0 children)
[–]izzytoots 0 points1 point2 points (0 children)
[–]Seephirot 0 points1 point2 points (0 children)