up
This commit is contained in:
parent
83b93e5992
commit
9ad9063d00
742 changed files with 884 additions and 779 deletions
11
1-js/04-object-basics/01-object/3-is-empty/solution.md
Normal file
11
1-js/04-object-basics/01-object/3-is-empty/solution.md
Normal file
|
@ -0,0 +1,11 @@
|
|||
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;
|
||||
}
|
||||
```
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue