Javascript Number isDivisor(num)

Description

Javascript Number isDivisor(num)

Number.prototype.isDivisor = function (num) {
    "use strict";
    var ans = false;
    if ((this / num).isInteger()) {
        ans = true;/*ww w . j a v  a2s.c  om*/
    }
    return ans;
};

Javascript Number isDivisor(num)

Number.prototype.isDivisor = function (num){
  var ans = false;
  if((this/num).isInteger()){
    ans = true;//from w w w.j  a v a  2s . c  o m
  }
  return ans;
}



PreviousNext

Related