Wolfram Computation Meets Knowledge

EmptyQ

Test whether a structure can be considered empty

ResourceFunction["EmptyQ"][expr]

gives True if expr is an empty structure and False otherwise.

Details and Options

Recognized structures include: List, String, Association, Dataset, Graph, and SparseArray, File, CloudObject, Graphics, and Databin.
A structure must exist to be considered empty.
A File object is considered empty if it is an empty file or an empty directory.