Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Check if a value is classified as a boolean primitive. Return true or false. Boolean primitives are true and false.
function booWho(bool) {
// What is the new fad diet for ghost developers? The Boolean.
//check if the value 'bool' is strictly true or false, this means the value is a Boolean Primitive and should return true.
//Everything else should return false.
if(bool === true || bool === false){
return true;
else {
return false;

This comment has been minimized.

Copy link

@saman-taghavi saman-taghavi commented May 30, 2021

dude loved your gist! 👍
here is my version based on yours

function booWho(bool) {
  return (bool === true || bool === false)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment