WLJS LogoWLJS Notebook

VectorQ

VectorQ[expr] gives True if expr is a list with no nested lists (a flat vector).

VectorQ[expr, test] gives True only if test yields True for each element.

Examples

Test for vectors:

VectorQ[{1, 2, 3}]
(* True *)

Nested lists are not vectors:

VectorQ[{{1, 2}, {3, 4}}]
(* False *)

Test for numeric vectors:

VectorQ[{1, 2, 3}, NumericQ]
(* True *)

Please visit the official Wolfram Language Reference for more details.

On this page