Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including is-boolean with all npm packages installed. Try it out:

var isBoolean = require("is-boolean")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

is-boolean v0.0.1

Predicate that returns true for "boolean" values.

is-boolean

Predicate that returns true for boolean values.

Install

npm install is-boolean
bower install is-boolean

Usage

var isBoolean = require('is-boolean');

console.log(isBoolean(false)); // true
console.log(isBoolean(true)); // true
console.log(isBoolean(new Boolean(1))); // true
console.log(isBoolean(!!'foo')); // true
console.log(isBoolean(!'foo')); // true
console.log(isBoolean('')); // false
console.log(isBoolean([])); // false
console.log(isBoolean(0)); // false
console.log(isBoolean(null)); // false
console.log(isBoolean(undefined)); // false
console.log(isBoolean(1)); // false
console.log(isBoolean({})); // false
console.log(isBoolean(function() {})); // false
console.log(isBoolean(/foo/gi)); // false
console.log(isBoolean(NaN)); // false

License

MIT

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free