en.javascript.info/1-js/3-object-basics/1-object/3-is-empty/task.md
Ilya Kantor 3f5f2cac8b work
2016-07-22 20:47:41 +03:00

310 B

importance: 5


Check for emptiness

Write the function isEmpty(obj) which returns true if the object has no properties, false otherwise.

Should work like that:

let schedule = {};

alert( isEmpty(schedule) ); // true

schedule["8:30"] = "get up";

alert( isEmpty(schedule) ); // false