Skip to content

Use array literal for defining a new array #2

Description

@jtwalters

In your code I see a lot of:

var myarray = Array();

type statements. This seems like a mistake. Perhaps you meant new Array()?. But, the recommended way to create a new, empty array is using the array literal:

var myarray = new Array(); // ok, but not recommended 
var myarray = []; // recommended

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions