Node-Red configuration
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

to-positive-integer.js 291B

12345678910
  1. 'use strict';
  2. var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');
  3. var $RangeError = RangeError;
  4. module.exports = function (it) {
  5. var result = toIntegerOrInfinity(it);
  6. if (result < 0) throw new $RangeError("The argument can't be less than 0");
  7. return result;
  8. };