I am a bit lost here and think I did something like this in the past. Say I have array that I want to call the record length as follows:
dataRecords = data_fish.length
or
dataRecords = data_dogs.length
But I want to have a function to dynamicaly call the length but want to use variables like:
recordCatagory = fish
getLength(recordCatagory)
function getLength(recordCatagory) {
arrayToCall= "data_" + recordCatagory
dataRecords = arrayToCall.length
}
Is it possible?
dataRecords = data_fish.length
or
dataRecords = data_dogs.length
But I want to have a function to dynamicaly call the length but want to use variables like:
recordCatagory = fish
getLength(recordCatagory)
function getLength(recordCatagory) {
arrayToCall= "data_" + recordCatagory
dataRecords = arrayToCall.length
}
Is it possible?