How to declare array of objects with JavaScript? To declare array of objects with JavaScript, we declare an array with object literals. For instance, we write const sample = [{}, {}, {} /*, ... */]; to declare the sample array with empty objects inside it.