Skip to content

Navigation Menu

Sign in
Sign up

Removed confusing use of new Array() - #35

Open
coolaj86 wants to merge 1 commit into
robrighter:master from
coolaj86:patch-1
Open

Removed confusing use of new Array() #35
coolaj86 wants to merge 1 commit into
robrighter:master from
coolaj86:patch-1

Conversation

@coolaj86

@coolaj86 coolaj86 commented May 27, 2013

Copy link
Copy Markdown

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

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /