Codecademy: JavaScript “Search Text for Your Name” 7/7 – Victory!

My Sunday nights are even more crazier. “Log it!” 6/7 code: var text = “Adam said: Who the hell is this, paging me at 5:45 in the morning \ crack of dawning. Wipe the cold out of my eye, see who’s this paging \ me, and why. My name is Biggie Adam Smalls.”; var myName = “Adam”; var hits = []; for (var i = 0; i < text.length; i++) { if (myName[0] === text[i]) …

Read more

Codecademy: JavaScript Build “Rock, Paper, Scissors” 9/9 – Next Steps

My Saturday nights are wild. Below is my solution to Codecademy’s JavaScript 9/9. The three goals of the tasks were to: What if a user makes an inappropriate choice like ‘dog’? How can we extend the function to handle that? What if players in the game could also choose Rope in this game? In this version, if both players make the same choice, the game returns a tie. What if the game didn’t end there …

Read more