ok
This commit is contained in:
parent
9064e35f3f
commit
4c531b5ae7
371 changed files with 338 additions and 316 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/4-object-basics/01-object/3-is-empty/_js.view/test.js
Normal file
11
1-js/4-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