Skip to content

Files

Latest commit

 

History

History
14 lines (8 loc) · 604 Bytes

no-construct.md

File metadata and controls

14 lines (8 loc) · 604 Bytes

Pattern: Forbidden constructor

Issue: -

Description

Disallows access to the constructors of String, Number, and Boolean. Disallows constructor use such as new Number(foo) but does not disallow Number(foo).

Rationale: There is little reason to use String, Number, or Boolean as constructors. In almost all cases, the regular function-call version is more appropriate.

Further Reading