Skip to content

Instantly share code, notes, and snippets.

@ihorkatkov
Created July 23, 2015 08:33
Show Gist options
  • Save ihorkatkov/4b672a910f82af2a5f07 to your computer and use it in GitHub Desktop.
Save ihorkatkov/4b672a910f82af2a5f07 to your computer and use it in GitHub Desktop.
[JS] Функция multiplyNumeric получает объект и умножает все численные свойства на 2
function isNumeric(n) {
return !isNaN(parseFloat(n)) && isFinite(n)
}
function multiplyNumeric(obj) {
for (var i in obj) {
if (isNumeric(obj[i])) {
obj[i] *= 2;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment