is-eq-four
Version:
Returns true if the given number is 4, false otherwise.
39 lines (30 loc) • 889 B
JavaScript
;
module.exports = is4;
const is3 = require('is-eq-three');
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 is4(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 4
return isTrue({result: is3(jQuery.subtract(x, 1))}, 'result');
}