We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9acc130 commit 642b563Copy full SHA for 642b563
1-js/06-advanced-functions/01-recursion/article.md
@@ -302,7 +302,7 @@ let company = {
302
salary: 1000
303
}, {
304
name: 'Alice',
305
- salary: 600
+ salary: 1600
306
}],
307
308
development: {
@@ -350,7 +350,7 @@ The algorithm is probably even easier to read from the code:
350
351
```js run
352
let company = { // the same object, compressed for brevity
353
- sales: [{name: 'John', salary: 1000}, {name: 'Alice', salary: 600 }],
+ sales: [{name: 'John', salary: 1000}, {name: 'Alice', salary: 1600 }],
354
355
sites: [{name: 'Peter', salary: 2000}, {name: 'Alex', salary: 1800 }],
356
internals: [{name: 'Jack', salary: 1300}]
@@ -372,7 +372,7 @@ function sumSalaries(department) {
372
}
373
*/!*
374
375
-alert(sumSalaries(company)); // 6700
+alert(sumSalaries(company)); // 7700
376
```
377
378
The code is short and easy to understand (hopefully?). That's the power of recursion. It also works for any level of subdepartment nesting.
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments