Created
September 6, 2017 14:24
-
-
Save stelt/33602178cd37f2d1698c0a181a183d2e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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