Update is.md

This commit is contained in:
Angelos Chalaris
2018-01-17 21:30:31 +02:00
committed by GitHub
parent 4feb68e848
commit f68f2e542e

View File

@ -1,6 +1,6 @@
### is ### 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`. 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(Set, new Set()); // true
is(WeakMap, new WeakMap()); // true is(WeakMap, new WeakMap()); // true
is(WeakSet, new WeakSet()); // 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
``` ```