I just found out that Arrays inherit directly from Object in javascript. I'm finding the difference between an array and an object is fairly minuscule.
How do i know when to use one over the other?
When you need to depend on the order of the elements in the collection, use Arrays, when order is not important, use objects. Order is not guaranteed in objects, but they provide for fast key-value pair lookups.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With