From 8f839542b61a6bb0188146c3f06be68a169c742d Mon Sep 17 00:00:00 2001 From: Meet Zaveri Date: Wed, 13 Dec 2017 21:52:51 +0530 Subject: [PATCH] Create check_for_boolean --- snippets/check_for_boolean | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 snippets/check_for_boolean diff --git a/snippets/check_for_boolean b/snippets/check_for_boolean new file mode 100644 index 000000000..a96719aea --- /dev/null +++ b/snippets/check_for_boolean @@ -0,0 +1,10 @@ +### Check for Boolean Primitive Values + +Check if a value is classified as a boolean primitive. Return true or false. + +function booWho(bool) { + return typeof bool === 'boolean'; +} + +// test here +booWho(null);