/is/array
stdChecks if the given argument is an array.
Type signature
(x?: unknown) => boolean
Questions
- How to check if a given value is an array?
(x?: unknown) => boolean
(x?: unknown) => x is boolean
(x?: unknown) => boolean
byte(128);
// ⇒ true
Try in REPL
byte(325);
// ⇒ false
Try in REPL
byte(65.5);
// ⇒ false
Try in REPL
(x?: unknown) => boolean
(x?: unknown) => boolean
defined(undefined);
// ⇒ false
Try in REPL
defined(null);
// ⇒ true
Try in REPL
defined(0);
// ⇒ true
Try in REPL
defined({ a: 1 });
// ⇒ true
Try in REPL
(x?: unknown) => x is Function
_function((x) => x + 5);
// ⇒ true
Try in REPL
(x?: unknown) => boolean
<T>(val: T) => val is NonNullable<T>
nonNullable(null);
// ⇒ false
Try in REPL
nonNullable(undefined);
// ⇒ false
Try in REPL
nonNullable(false);
// ⇒ true
Try in REPL
nonNullable({ a: 1 });
// ⇒ true
Try in REPL
(x?: unknown) => boolean
normal(0.75);
// ⇒ true
Try in REPL
normal(-1);
// ⇒ false
Try in REPL
normal(2.5);
// ⇒ false
Try in REPL
(x?: unknown) => boolean
(x?: unknown) => boolean
(x?: unknown) => x is string