up
This commit is contained in:
parent
83b93e5992
commit
9ad9063d00
742 changed files with 884 additions and 779 deletions
|
@ -0,0 +1,7 @@
|
|||
function isEmpty(obj) {
|
||||
for (let key in obj) {
|
||||
// if the loop has started, there is a prorty
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
11
1-js/04-object-basics/01-object/3-is-empty/_js.view/test.js
Normal file
11
1-js/04-object-basics/01-object/3-is-empty/_js.view/test.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
describe("isEmpty", function() {
|
||||
it("returns true for an empty object", function() {
|
||||
assert.isTrue(isEmpty({}));
|
||||
});
|
||||
|
||||
it("returns false if a property exists", function() {
|
||||
assert.isFalse(isEmpty({
|
||||
anything: false
|
||||
}));
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue