Cette page n'est pas encore disponible en français, sa traduction est en cours. Si vous avez des questions ou des retours sur notre projet de traduction actuel, n'hésitez pas à nous contacter.
Metadata
ID:javascript-code-style/no-array-constructor
Language: JavaScript
Severity: Warning
Category: Error Prone
Description
Array literal notation cannot be redefined. It is preferred over the Array constructor.
The Array constructor is a common source of errors as it might behave unexpectedly when used with a single parameter. It creates an array with of N length instead of initializing an Array with the provided param.