Visual Home Home

Mass Producing Objects

Arrays can be thought as a train with multiple bogies, going one after the other. In JS, after functions the versatile concept is Array. Array by itself is a "Object" template. That means, array has functionalities and contains the data. Our table has been Customised for the family of 4 and their names are printed.

Adding Bogies

We love to have more stuff, so does the family that own the table. On top of that they love Magic. They want the table to materialise with a Click of a Mouse. And their wish is granted, thanks to the Objects and Arrays, especially Arrays in JS

Array allow the new objects to be added when the program is running. In our case the P5js draw() loop is executing. When the mouse is clicked, the new object with unique name appears out of Thin Pixels and even maintains the colors.

All these magic is possible with the help of Loops and Logics that can be extended to the Classes that is created first. There is objects now, next question is how to communicate with them?