16 April 2016
This week I paired up with a fellow student, Uili, to complete the freecodecamp challenge to create a javascript calculator. It is how I came across the eva() function.
What a life saver. What a time saver. Somehow I wasn’t aware of this method, so my plans were rather more complicated, creating various methods to call depending on which operator keys were pressed. Instead we just collected a string of the buttons pressed, and passed it to the eval() function. Here’s the calculator we whipped up in a few hours, nothing too fancy, but a good exercise in what we have been learning this week.
You can check out the calculator I made with my partner, Uili, here: Vote For Pedro
Boom! Each time I learn a new function or method that seems so obvious, I get really excited about learning new stuff. The alternative negative approach of “how the hell did I not know about that? I’m so stupid” is al too easy to fall in to. Lightbulb moments are amazing!