What is JavaScript

  • JavaScript is another programming language like Python. It works with other coding languages like CSS and HTML.
  • JavaScript includes variables, operators, functions, loops, strings, and much more.

JavaScript can be used for math!

Rounding

Math.round(4.6);
5
Math.round(2.3);
2

Ceiling Function

Math.ceil(4.9);
5
Math.ceil(4.2);
5

Floor Function

Math.floor(6.7);
6
Math.floor(2.1);
2

Positive and Negative Signs

Math.sign(2);
1
Math.sign(-4);
-1

Powers

Math.pow(4, 2);
16
Math.pow(3, 4);
81

Square Roots

Math.sqrt(4);
2
Math.sqrt(15);
3.872983346207417

Absolute Value

Math.abs(7);
7
Math.abs(-54278);
54278