en.javascript.info/1-js/5-data-structures/4-object2/5-count-properties/task.md
Ilya Kantor 057783d216 work
2016-07-21 17:05:55 +03:00

310 B

importance: 5


Count properties

Write a function count(obj) that returns the number of properties in the object:

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.