Are these subproperties? What is the correct term?

I have a question over terminology. In JavaScript, I have an array made up of properties that are themselves objects, delimited by braces. Would the properties of the object properties of the array object be the array's subproperties? Is there a specific term for this?

Here's an example:

 var arrayObject = [
      {subproperty1: ["value1", "value2", "value3"], subproperty2: value}, 
      {subproperty1: ["value4", "value5", "value6"], subproperty2: value},
      {subproperty1: ["value7", "value8", "value9"], subproperty2: value},
 ];

If I use the Object.keys function to get the property names of arrayObject, the property names are the index values--0, 1, 2.

 console.log(Object.keys(arrayObject)); // ["0", "1", "2"]

Would the properties of the objects 0, 1, and 2 that are the properties of arrayObject be defined as the subproperties of arrayObject? I just want to be terminologically accurate.

Answers:

Answer

not really. also I would not say that an array is made up of properties but contains elements. Objects have properties, arrays have elements.

subproperty as a term sounds strange. I don't think there is a term for what you want, also consider that theese objects may have properties that are other objects.

I would describe your structure as an array with elements where each element has the properties subproperty1 and subproperty1.

Also consider that not every object in an array must have the same properties.

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.