en.javascript.info/1-js/4-data-structures/4-object/5-count-properties/task.md
Ilya Kantor b043ea701d works
2016-07-03 18:27:36 +03:00

21 lines
310 B
Markdown

importance: 5
---
# Count properties
Write a function `count(obj)` that returns the number of properties in the object:
```js
let user = {
name: 'John',
age: 30
};
alert( count(user) ); // 2
```
Try to make the code as short as possible.
P.S. Ignore symbolic properties, count only "regular" ones.