Skip to content

Removed confusing use of new Array() #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

coolaj86
Copy link

I argue that [] should be used instead of new Array(), and especially instead of new Array(arg0, arg1, ...) to avoid confusion (i.e. I was confused when I saw it).

I wasn't sure if there would be a bug or not in the case that name was a number and value was undefined. According to Firefox, it should never result in a bug. I assume Chrome behaves the same way.

https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array

I argue that `[]` should be used instead of `new Array()`, and especially instead of `new Array(arg0, arg1, ...)` to avoid confusion (i.e. I was confused when I saw it).

I wasn't sure if there would be a bug or not in the case that `name` was a number and `value` was undefined. According to Firefox, it should never result in a bug. I assume Chrome behaves the same way.

https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant