Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

88
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!