en.javascript.info/1-js/4-data-structures/4-object/2-is-empty/task.md
Ilya Kantor 2b874a73be ok
2016-03-09 00:16:22 +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