diff --git a/1-js/03-code-quality/04-ninja-code/article.md b/1-js/03-code-quality/04-ninja-code/article.md index 7ee4e2e0..0b97b3ff 100644 --- a/1-js/03-code-quality/04-ninja-code/article.md +++ b/1-js/03-code-quality/04-ninja-code/article.md @@ -1,4 +1,4 @@ -# How to write bad code? +# Ninja code 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. diff --git a/1-js/04-object-basics/01-object/3-is-empty/solution.md b/1-js/04-object-basics/01-object/3-is-empty/solution.md index 9e8b3d90..cd50543e 100644 --- a/1-js/04-object-basics/01-object/3-is-empty/solution.md +++ b/1-js/04-object-basics/01-object/3-is-empty/solution.md @@ -1,11 +1,10 @@ Just loop over the object and `return false` immediately if there's at least one property. ```js -function isEmpty(obj) +function isEmpty(obj) { for(let key in obj) { return false; } return true; } ``` - diff --git a/1-js/04-object-basics/01-object/article.md b/1-js/04-object-basics/01-object/article.md index 1d3c63af..45c5d22a 100644 --- a/1-js/04-object-basics/01-object/article.md +++ b/1-js/04-object-basics/01-object/article.md @@ -233,12 +233,11 @@ In real code we often use existing variables as values for property names. For instance: ```js run -function makeUser() { - let name = prompt("Name?"); - let age = prompt("Age?"); +function makeUser(name, age) { return { name: name, age: age + // ...other properties }; } @@ -256,6 +255,7 @@ function makeUser(name, age) { return { name, // same as name: name age // same as age: age + // ... }; */!* }