Numbers (as well as strings and booleans) are passed by value. You're copying the value the a new variable where you're modifying it.
You need to modify the object's property directly:
for (var key in menu) {
if (typeof menu[key] === 'number') {
menu[key] *= 2;
}
}
Also, JavaScript will not return "number"
if you ask for typeof("200")
; it will return "string"
. You need a numeric literal, not a string:
var menu = {
width: 200,
height: 300,
title: "My menu"
};