From f68f2e542e8051fc1549c8d3ebf863eb2bc28b34 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Wed, 17 Jan 2018 21:30:31 +0200 Subject: [PATCH] Update is.md --- snippets/is.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/snippets/is.md b/snippets/is.md index a43e7744c..de07e6070 100644 --- a/snippets/is.md +++ b/snippets/is.md @@ -1,6 +1,6 @@ ### is -Checks if the provided value is of the specified type. +Checks if the provided value is of the specified type (doesn't work with literals). Use the `instanceof` operator to check if the provided value is of the specified `type`. @@ -16,4 +16,10 @@ is(RegExp, /./g); // true is(Set, new Set()); // true is(WeakMap, new WeakMap()); // true is(WeakSet, new WeakSet()); // true +is(String, ''); // false +is(String, new String('')); // true +is(Number, 1); // false +is(Number, new Number(1)); // true +is(Boolean, true); // false +is(Boolean, new Boolean(true)); // true ```