Skip to content

Variable: EMPTY_OBJ

const EMPTY_OBJ: Record<string, unknown>

An empty object that is frozen in development mode for immutability. Use this constant instead of creating new empty objects to improve performance.

Example

typescript
// Good
const defaultOptions = { ...EMPTY_OBJ, userOptions }

// Instead of
const defaultOptions = { ...{}, userOptions }

Released under the MIT License.