Home > Web Front-end > JS Tutorial > Summary of common methods of JavaScript Math objects_javascript skills

Summary of common methods of JavaScript Math objects_javascript skills

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-05-16 15:03:20
Original
1184 people have browsed it

Math.abs(x): Returns the absolute value of the number

Math.ceil(x): round up

Math.floor(x): round down

Math.max(x,y): maximum value

Math.min(x,y): minimum value

Math.random(x): random number

Math.round(x): Round

Get a random number within the specified range

var x=Math.floor(Math.random()*(max-min+1))+min;

The above summary of common methods of JavaScript Math objects is all the content shared by the editor. I hope it can give you a reference, and I hope you will support Script Home.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
What are JavaScript hook functions?
From 1970-01-01 08:00:00
0
0
0
What is JavaScript garbage collection?
From 1970-01-01 08:00:00
0
0
0
c++ calls javascript
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template