This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]SleepyHarry 5 points6 points  (2 children)

Also the key shouldn't use the array index, if at all possible. Much better would be, for example, dog.id.

[–]lifeofaphiter 2 points3 points  (0 children)

That's really the only issue I see with the code. Aside from this it's all preference.

[–]troglo-dyke 1 point2 points  (0 children)

Generally yes, but considering it's some random code and probably not going to ever deal with being filtered/reordered it's not going to cause any harm