“Compruebe si el número está entre 1 y 100 JS” Código de respuesta

Número de JavaScript entre valores

Number.prototype.between = function(a, b) {
  var min = Math.min.apply(Math, [a, b]),
    max = Math.max.apply(Math, [a, b]);
  return this > min && this < max;
};

var windowSize = 550;

console.log(windowSize.between(500, 600));
Prafy

Si entre dos números JavaScript

if (500 < thenumber && thenumber < 600) {
  // ...
}
Confused Sphere

Compruebe si el número está entre 1 y 100 JS

Number.prototype.between=function(20,100){
 var min= Math.min.apply(Math,[20,100]),
     max=Math.max.apply(Math,[20,100]);
  return this > min && this < max;
};

var windowSize=550;

console.log(windowSize.between(20,100) )
Egli Cobaj

Respuestas similares a “Compruebe si el número está entre 1 y 100 JS”

Preguntas similares a “Compruebe si el número está entre 1 y 100 JS”

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código