Skip to content

Commit 468a769

Browse files
committed
fixes
1 parent 25e97bb commit 468a769

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

1-js/03-code-quality/04-ninja-code/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# How to write bad code?
1+
# Ninja code
22

33
Programmer ninjas of the past used these tricks to make code maintainers cry. Code review gurus look for them in test tasks. Novice developers sometimes use them even better than programmer ninjas.
44

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
Just loop over the object and `return false` immediately if there's at least one property.
22

33
```js
4-
function isEmpty(obj)
4+
function isEmpty(obj) {
55
for(let key in obj) {
66
return false;
77
}
88
return true;
99
}
1010
```
11-

1-js/04-object-basics/01-object/article.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,12 +233,11 @@ In real code we often use existing variables as values for property names.
233233
For instance:
234234

235235
```js run
236-
function makeUser() {
237-
let name = prompt("Name?");
238-
let age = prompt("Age?");
236+
function makeUser(name, age) {
239237
return {
240238
name: name,
241239
age: age
240+
// ...other properties
242241
};
243242
}
244243

@@ -256,6 +255,7 @@ function makeUser(name, age) {
256255
return {
257256
name, // same as name: name
258257
age // same as age: age
258+
// ...
259259
};
260260
*/!*
261261
}

0 commit comments

Comments
 (0)