This means that you can build classes with properties and methods similar to Java, C++ or C#. You can access object properties in two ways: objectName.propertyName. console.log(a[1]); Above statement prints ‘For’ from the above example in the console window. or. the numbers 01, 02 will be generated with some i,k vars because all this is inside a for. 4,102 5 5 gold badges 29 29 silver badges 66 66 bronze badges. 1 "02": "Ramones" I assume? Array Elements Can Be Objects. This method changes the length of the array. In the previous code example, the function uses "document.write()". person.lastName; Try it Yourself » Example2. To add an object at the first position, use Array.unshift. Tasks. let … notifier; return this. The name:value pairs can consist of properties that may contain any data type — including strings, numbers, and Booleans — as well as methods, which are functions contained within an object. Object-Oriented JavaScript: Creating Methods . Follow edited Oct 25 '16 at 21:40. pmiranda. You can have arrays in an Array: myArray[0] = Date.now; myArray[1] = myFunction; myArray[2] = myCars; Array Properties and Methods. Spread syntax can be used when all elements from an object or array need to be included in a list of some kind. Arrays of objects don't stay the same all the time. * The JSON syntax is derived from JavaScript object notation syntax, but the JSON format is text only. You only need to change your logic inside the for loop : for(var i = 0; i