“JS podłoga” Kod odpowiedzi

Math.Floor 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
BlackCat

JS podłoga

// 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
MattDESTROYER

Odpowiedzi podobne do “JS podłoga”

Pytania podobne do “JS podłoga”

Więcej pokrewnych odpowiedzi na “JS podłoga” w JavaScript

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu