Skip to content

Instantly share code, notes, and snippets.

@stelt
Created September 6, 2017 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stelt/33602178cd37f2d1698c0a181a183d2e to your computer and use it in GitHub Desktop.
Save stelt/33602178cd37f2d1698c0a181a183d2e to your computer and use it in GitHub Desktop.
var menu = {
width: 200,
height: 300,
title: "My menu"
};
function isNumeric(n) {
return !isNaN(parseFloat(n)) && isFinite(n)
}
function multiplyNumeric(obj){
for(var i in obj){
if(isNumeric(obj[i]) === true){
obj[i] *= 2;
}
}
return obj;
}
console.log(multiplyNumeric(menu));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment