A plain object is one created by the Object constructor (or object literal syntax),
with Object.prototype as its direct prototype. This excludes built-in objects like
Date, RegExp, Array, Buffer, DOM elements, and objects created with custom constructors.
This strict definition ensures safe operations like deep cloning, serialization,
and property enumeration that assume simple key-value structure without special
behavior or internal state.
Checks if a value is a plain object.
A plain object is one created by the Object constructor (or object literal syntax), with Object.prototype as its direct prototype. This excludes built-in objects like Date, RegExp, Array, Buffer, DOM elements, and objects created with custom constructors.
This strict definition ensures safe operations like deep cloning, serialization, and property enumeration that assume simple key-value structure without special behavior or internal state.