work
This commit is contained in:
parent
057783d216
commit
3f5f2cac8b
324 changed files with 669 additions and 286 deletions
33
1-js/3-object-basics/1-object/8-multiply-numeric/task.md
Normal file
33
1-js/3-object-basics/1-object/8-multiply-numeric/task.md
Normal file
|
@ -0,0 +1,33 @@
|
|||
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.
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue