Currently, I am working with an object where I am inserting integers, strings, and arrays into one main array. My goal is to determine the length of a specific array that is located within this main array.
Below is the code I am using:
var all_categories = [];
all_categories.push({
title: theTitle,
id: theId,
sub: subcategories
});
I am aware that the general method for getting the length of an array is by using all_categories.length
. However, attempting to access the length of a specific array within 'sub' like all_categories[0].sub[0].length
does not work due to the function's non-existence.
Any suggestions for finding a solution or implementing a workaround?