Web Dev Roadmap for Beginners (Free!): https://bit.ly/DaveGrayWebDevRoadmap
In this video we'll discuss JavaScript Math Methods and Properties. You will also learn how to generate a random number with JavaScript. All in less than 6 minutes!
▶ This video is part of the JavaScript Tutorials for Beginners Playlist found here: https://www.youtube.com/playlist?list=PL0Zuz27SZ-6Oi6xNtL_fwCrwpuqylMsgT
Quick Concepts outline:
The JavaScript Math Object
(00:00) Intro
(0:06) MDN Resources
(0:25) Dev Environment
(0:48) Math.PI property
(1:05) Math.trunc() method
(1:25) Math.round() method
(1:48) Math.ceil() method
(2:02) Math.floor() method
(2:15) Math.pow() method
(2:36) Math.min() method
(2:49) Math.max() method
(3:12) Math.random() method
(3:28) How to generate a random number with JavaScript
(4:21) Choose Math.floor() instead of Math.ceil() in your random number expression and Why!
Further Reading:
MDN Web Docs - Math Reference: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math
TutorialsPoint.com - JavaScript - The Math Object: https://www.tutorialspoint.com/javascript/javascript_math_object.htm
More Beginner JS Videos:
freeCodeCamp: https://youtu.be/PkZNo7MFNFg
Traversy Media: https://youtu.be/hdI2bqOjy3c
The Net Ninja: https://youtu.be/iWOYAxlnaww
Follow Me:
Twitter: https://twitter.com/yesdavidgray
Medium: https://medium.com/@davegray_86804
#Javascript #Math #Random