is-eq-zero
Version:
Returns true if the given number is 0, false otherwise.
23 lines (18 loc) • 565 B
JavaScript
require("mocha");
const assert = require("assert");
const is0 = require("./");
describe("is0", function() {
it("should return true if the number is 0", function() {
assert(is0(0));
});
it("should return false if the number is not 0", function() {
assert(!is0(0 + 1));
});
it("should return false if the number is not a number at all", function() {
assert(!is0(null));
assert(!is0(undefined));
assert(!is0("0"));
assert(!is0({prop: "0"}));
});
});
;