Math.floor() in javascript

     The Math.floor() function returns the largest integer less than or equal to a given number. floor() is a static method of Math, you always use it as Math.floor(), rather than as a method of a Math object you created (Math is not a constructor).

Syntax

   Math.floor(value);
Example

   Math.floor( 40.95); //  40
   Math.floor(-48.95); // -49


Example Program:- (Editor)


Editor is Loading...

Advertisement

0 nhận xét:

Đăng nhận xét