Looking at the code snippet below, I currently have an array containing two JSON objects. However, if I need to create 20 objects, is there a more efficient way than manually writing each object in the array? Furthermore, is it possible to generate these objects during runtime and assign random values to them as they are being created?
I understand that JavaScript has its limitations when compared to object-oriented programming languages like Java or C#, where you could easily create objects from a single class and add them to a list.
var numbers = [
{
"x": 100,
"y": 100,
"visible": true,
"value": 23
},
{
"x": 150,
"y": 100,
"visible": true,
"value": 19
},
];