I have the following function:
<code>
function setupmodels2() {
var md = myAutos[0].model;
models2[0] = md;
mdIndex = 0;
for(var i = 1; i < myAutos.length; i++) {
if(myAutos[i].model == md){
continue;
}
else{
md = myAutos[i].model;
models2[++mdIndex] = md;
}
}
}
</code>
The function works fine, it retrieves all the models from the array objects. What I want to do is be more specific and retrieve myAutos[i].model based on the myAutos[i].make == "Ford". I have placed the test condition in several places within the function. I even initialized a variable outside the function making it global thinking it would help in some way, it didn't. I am new to JS and really need some help. I have invested lots of time and decided to come to the forum for help so I do not keep spinning my wheels for nothing.
Many thanks in advance for your help!
Thanks,
7079



Reply With Quote

Bookmarks