Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js floor a number

// Math.floor returns the floor of a number
console.log(Math.floor(1.5)); // -> 1
// Using two bitwise not operators '~' you can also get the floor of a number
console.log(~~1.5); // -> 1
Source by devswisdom.com #
 
PREVIOUS NEXT
Tagged: #js #floor #number
ADD COMMENT
Topic
Name
6+3 =