March 8th, 2020
Welcome back! We’re covering basic Mathematics in Javascript today! I have a feeling we’ll have a lot of fun today! Feel free to check out Day 6 if you haven’t!
So, I know we are no mathematicians. We don’t like complex mathematical computations. That’s where Math Object comes in. Here, we can use the Math Object in Javascript to help us in counting complex Math problems, that would be very difficult if this tool didn’t exist.
So, what is Math in Javascript? It is a built-in object that has properties and methods for mathematical constants and functions. Put simply, we can display the value of Pi, square root of a number, log, sin, cos, tan, etc. You must be thinking, how are we going to use all of this?? All I can say is that from my experience, you usually use only at most 5% of the whole Math Object. The most commonly used built-in functions are as follows.
As you can see, the Math Object gives so much flavor to the usual Javascript world! You can use random to implement a dice too! There’s so much you can do, let your imagination flow!!
With this tool, it opens the gates to so much opportunity to create more creative ideas! This is our topic today and be sure to explore the Math Object!
For more reference, feel free to head over to the official documentation.
So our session today ends here folks! Functions are up next! If you have any questions, feel free to DM me on Twitter or LinkedIn! See you soon and have a nice day!