floor in js
console.log(Math.floor(5.95));
// expected output: 5
console.log(Math.floor(5.05));
// expected output: 5
console.log(Math.floor(5));
// expected output: 5
console.log(Math.floor(-5.05));
// expected output: -6// positive
console.log(Math.floor(7.25)); // 7
console.log(Math.floor(0.99)); // 0
// negative
console.log(Math.floor(-2.1)); // -3
console.log(Math.floor(-9.5)); // -10
// objects, strings, functions
console.log(Math.floor("hello")); // NaN
console.log(Math.floor({name: 'John', age: '25'})); // NaN
console.log(Math.floor(console.log)); // NaNMath.floor(1.6);
result: 1
Also in JavaScript:
- check if modal hide jquery
- iframe in react native
- react transition group
- how to get connection string value from appsettings.json in .net core
- req.params.id in nodejs
- how to get code suggestions for react components
- javascript get element by multiple class
- javascript create array of objects with key
- how to draw flower petals around circle javascript
- how to install vue
- javascript execute string code
- make web page refresh on javascript
- jquery siblings
- js mouse enter
- javascript encode url to decode C#
- js tab in textarea
- javascript is array empty
- prepend javascript
- json color types
- how to check value of checkbox in react
- how to craete a shopping cart in node js
- cascading dropdown for forms react
- angular scroll to element horizontally
- nodejs download image from url