en.javascript.info/1-js/04-object-basics/01-object/3-is-empty/solution.md
2017-09-28 07:31:09 +03:00

10 lines
190 B
Markdown

Just loop over the object and `return false` immediately if there's at least one property.
```js
function isEmpty(obj) {
for (let key in obj) {
return false;
}
return true;
}
```