I commonly use arrays to achieve tasks that might be better suited using objects. Rather than continuing to wonder if it would be better to use an object for a task, I've decided to pose the question on Stack Overflow.
array = ["James", 17];
object = {name:"James", age:17};
They both seem similar in syntax, and to me they seem to achieve the same thing when used. When should I use an an object over an array and vice versa? Are there general rules as to when I should use one over the other?