Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

89
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda