Nodejs Number Value Check odd()

Here you can find the source of odd()

Method Source Code

Number.prototype.odd = function(){
   return ( ( this % 2 ) == 1 )
}

Related

  1. isEven()
    Number.prototype.isEven = function() {
        return !(this % 2);
    
  2. isOdd()
    Number.prototype.isOdd = function () {
      return new Boolean(this.valueOf()&1);
    
  3. isOdd()
    function isOdd(num) {
      if (typeof num === 'number') {  
        return ((num % 2) === 1) || ((num % 2) === -1) ? true : false;
      else {
        throw 'Not a number';
    console.log(isOdd(3)); 
    ...
    
  4. isOdd()
    Number.prototype.isOdd = function() {
        return !!(this % 2);
    
  5. odd()
    Number.prototype.odd = function () {
      return (this % 2 == 1)
    
  6. isBetween(l,h)
    Number.prototype.isBetween = function(l,h){
      return (this >= l.val() && this <= h.val());
    
  7. isBetween(min, max, inclusive)
    Number.prototype.isBetween = function (min, max, inclusive) {
      return inclusive
        ? this >= min && this <= max
        : this > min && this < max;
    };
    
  8. isBetweenisBetween(a, b)
    Number.prototype.isBetween = function isBetween(a, b) {
      if(a <= this) {
        return this <= b;
      return this >= b;
    
  9. even()
    Number.prototype.even = function(){
        return (this % 2 === 0);
    };