Your OBJECTS array is an array of strings. It's not an array of objects.
Perhaps you meant it to be this:
var mainmenu = {width:250,height:250,backgroundcolor:"red"};
var mainviewer = {width:250,height:250,backgroundcolor:"green"};
var mainsearch = {width:250,height:250,backgroundcolor:"blue"};
var objects = [mainmenu, mainviewer, mainsearch];
FYI, I also had to put quotes around the color names because symbols like red are not defined.
And, if you want to iterate this with a name, you could do this:
var mainmenu = {name: "mainmenu", width:250,height:250,backgroundcolor:"red"};
var mainviewer = {name:"mainview", width:250,height:250,backgroundcolor:"green"};
var mainsearch = {name: "mainsearch", width:250,height:250,backgroundcolor:"blue"};
var objects = [mainmenu, mainviewer, mainsearch];
objects.forEach(function(item) {
log("the width of "+item.name+" is "+item.width);
});
or, a traditional for loop:
for (var i = 0; i < objects.length; i++) {
var item = objects[i];
console.log("the width of "+item.name+" is "+item.width);
});
Working demo: http://jsfiddle.net/jfriend00/abwgjed2/
Note: it is a bad idea to iterate arrays with the syntax for (item in objects). This iterates all properties of the item object, not just array elements. If there are ES5/ES6 polyfills being used, there may be some extra enumerable properties that will show up in the for (item in objects) iteration. Either use .forEach() or for (var i = 0; i < objects.length; i++).