Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

90
Vistas
adding documentation to prototype

i've been writing my own helper library for my day to day tinkering, and like to add documentation to each function i create. now the issue i am having is the following:

the way i add documentation to most of my function works and no issue lets take my (w3schools copied) rng

    /**
     * a function for generating an integer between a and b.
     * further documentation...
     * @param {!number} min - this is the lower bound
     * @param {!number} max - this is the higher bound
    */
    function random (min, max){
        return Math.floor(Math.random() * (max - min) ) + min;
    }

this works and gives me the proper instructions in my ide(?) vsc

now the issue is when i try to add it to an existing js object like number take my function to see if a number is between two other numbers

/**
 * a function for checking if n is between but not equals a and b.
 * @param {!number} lower - the lower number 
 * @param {!number} higher - the higher number
*/
Number.prototype.isBetween = function (lower, higher) {
    return (this > lower && this < higher || this > higher && this < lower) ? true : false;
}

this does not even give me the suggestion that myVar.isBetween(a,b) is a function nor gives it me any documentation

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda