Javatpoint Logo
Javatpoint Logo

JavaScript Math floor() method

The JavaScript math floor() method decreases the given number up to the closest integer value and returns it. If the given number is already an integer, the floor() method returns it directly.


The floor() method is represented by the following syntax:


num - A number.


A largest integer value, lower than or equal to the given number.

JavaScript Math floor() method example

Here, we will understand floor() method through various examples.

Example 1

Let's see an example to decreases the given number up to the closest integer value.

Test it Now



Example 2

In this example, we will use floor() method with negative numbers.

Test it Now



Example 3

Here, you can test floor() method with your own test cases.

Test it Now
Next TopicJavaScript Math

Youtube For Videos Join Our Youtube Channel: Join Now

Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA