I wrote a program where i can quesry whether an ice cream flavor is in my top ten, but no matter what i put, it says, "ice cream flavor" is not in top ten. Here is the code.


var iceCream = {
"0": "Chocolate Fudge Brownie",
"1": "Half Baked",
"2": "New York Super Fudge Chunk",
"3": "Coffee Heath Bar Crunch",
"4": "Cherry Garcia",
"5": "Mud Pie",
"6": "Milk & Cookies",
"7": "Cinnamon Buns",
"8": "Chocolate Chip Cookie Dough",
"9": "Boston Cream Pie",
};
var rankFlavor = function(flavor) {
for (var i = iceCream.length; i --{
if (iceCream[i] === flavor ) {
return flavor + " is number " + (i + 1) + " . "
}
}
return flavor + " is not among my top 10.";
};