Q:

Order Objects in JavaScript

Let's just say we have 2 JavaScript Objects likes this:
object1 = {
  test: {},
  test2: {},
  users: {},
  colors: {},
  dates:{}
}

object2 = {
  test2: {},
  dates:{},
  test: {},
  colors: {},
  users: {}
}

How can you take the order of object1 to object2 ? 

A:

JavaScript object has no concept of order. Order is only applicable to Arrays. Besides no one accesses JavaScript object with numerical indexes. You access it by name of the property. And you already know that name.
The two objects in your question has same properties. As the values are empty both objects are actually same. 

