make sure a solution always shows up, use "demo" if exists

This commit is contained in:
Ilya Kantor 2019-02-21 19:35:04 +03:00
parent 360be9ed99
commit 408ba7d4e4
25 changed files with 59 additions and 95 deletions

View file

@ -1,10 +1 @@
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;
}
```