|
JavaScript can be utilized to solve mathematical problems:
//calculate e5 Math.exp(5)
//calculate cos(2PI) Math.cos(2*Math.PI)
If
you intend to invoke Math multiple times in your script, a good
statement to remember is "with." By
using "with," you can omit the "Math." prefix
for any subsequent Math propertyi/methods/p> with (Math){ var
x= sin(3.5) var y=tan(5) var result=max(x,y) }
|