en.javascript.info/1-js/04-object-basics/01-object/8-multiply-numeric/task.md
Ilya Kantor 9ad9063d00 up
2016-11-28 21:35:42 +03:00

33 lines
522 B
Markdown

importance: 3
---
# Multiply numeric properties by 2
Create a function `multiplyNumeric(obj)` that multiplies all numeric properties of `obj` by `2`.
For instance:
```js
// before the call
let menu = {
width: 200,
height: 300,
title: "My menu"
};
multiplyNumeric(menu);
// after the call
menu = {
width: 400,
height: 600,
title: "My menu"
};
```
Please note that `multiplyNumeric` does not need to return anything. It should modify the object in-place.
P.S. Use `typeof` to check for a number here.