Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
</body>
</html>
 
var menu = {
  width: 200,
  height: 300,
  title: "My menu"
};
function isNumeric(n) {
  return !isNaN(parseFloat(n)) && isFinite(n);
}
function multiplyNumeric(obj) {
  for (var key in obj) {
    var objKey = obj[key];
    if (isNumeric(objKey)) {
      objKey *= 2;
    } 
  }
}
multiplyNumeric(menu);
console.log("menu width=" + menu.width + " height=" + menu.height + " title=" + menu.title);
// Работающий пример
// var menu = {
//   width: 200,
//   height: 300,
//   title: "My menu"
// };
// function isNumeric(n) {
//   return !isNaN(parseFloat(n)) && isFinite(n);
// }
// function multiplyNumeric(obj) {
//   for (var key in obj) {
 
//     if (isNumeric(obj[key])) {
//       obj[key] *= 2;
//     } 
//   }
// }
// multiplyNumeric(menu);
// console.log("menu width=" + menu.width + " height=" + menu.height + " title=" + menu.title);
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers