Рабочий код будет такой:
for (var propertyName in window) {
console.log(propertyName);
if (propertyName != 'sessionStorage' && propertyName != 'mozIndexedDB'){
var propertyType;
propertyType = typeof(window[propertyName]);
switch (propertyType) {
case "string":
console.log("String " + propertyType);
break;
case "number":
console.log("Number " + propertyType);
break;
default:
console.log("Default " + propertyType);
}
}
}
Дебаг строка:
console.log(propertyName);