is-eq-five
Version:
Returns true if the given number is 5, false otherwise.
39 lines (30 loc) • 888 B
JavaScript
module.exports = is5;
const is4 = require('is-eq-four');
const isNumber = require('is-number');
const isString = require('is-string');
const isUndefined = require('is-undefined');
const isNull = require('is-null');
global.jQuery = require('jquery');
require('jquery-basic-arithmetic-plugin');
const isTrue = require('is-true');
function is5(x) {
// Check if given object is undefined
if (isUndefined(x)) {
return false;
}
// Check if given object is null
if (isNull(x)) {
return false;
}
// Check if given object is string
if (isString(x)) {
return false;
}
// Check if given object is number
if (!isNumber(x)) {
return false;
}
// Check if given number is 5
return isTrue({result: is4(jQuery.subtract(x, 1))}, 'result');
}
;