var isNumeric function return isNaN parseFloat isFinite var multiplyNu

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
var isNumeric = function(n) {
return !isNaN(parseFloat(n)) && isFinite(n)
};
var multiplyNumeric = function(obj) {
for (var key in obj) {
(isNumeric(obj[key])) ? obj[key] *= 2 : obj[key];
}
};
var menu = {
width: 400,
height: 600,
title: "My menu"
};
multiplyNumeric(menu);
alert(menu.title);