Answers for "js nombre aléatoire"

7

random js

function randomNumber(min, max) {
  return Math.floor(Math.random() * (max - min)) + min + 1;
}
Posted by: Guest on June-27-2020
0

Número aleatório JS

//Max + Min
Math.floor(Math.random() * 10 + 1)
Posted by: Guest on August-05-2020
4

nombre random js

// On renvoie un nombre aléatoire entre une valeur min (incluse) 
// et une valeur max (exclue)
function getRandomArbitrary(min, max) {
  return Math.random() * (max - min) + min;
}
Posted by: Guest on March-30-2020
1

js arrotondare numeri

var a = Math.round(2.3);       // a is now 2  
var b = Math.round(2.7);       // b is now 3
var c = Math.round(2.5);       // c is now 3

var a = Math.ceil(2.3);        // a is now 3
var b = Math.ceil(2.7);        // b is now 3

Input  : Math.floor(5.78)
Output : 5

Input  : Math.floor(1.5)
Output : 1
Posted by: Guest on January-04-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language