In this video series I'll show you step by step how I built the javascript calculator for FreeCodeCamp using the react library.
In this video I'll be taking you through handling the four basic math operations - adding, subtracting, multiplying and diving - using the eval() function.
00:00 recap
00:30 explaining functionality
01:42 adding operator to state
02:25 cache all state properties in separate variables
02:55 switch
05:00 functionality for numbers
05:19 creating doMath()
06:22 getting the three arguments necessary
07:10 eval()
09:15 operator functionality
10:16 fixing the persisting operator
12:30 fixing division and multiplication
18:29 fixing the disappearing result
Useful links:
eval(): https://goo.gl/HNj5PJ
Download
0 formats
No download links available.
FreeCodeCamp - Javascript Calculator - PART 4 | NatokHD