Skip to content

Commit 8936bfe

Browse files
authored
Merge pull request #540 from matsilva/patch-1
Meta: Fix an error in the logResult example code
2 parents a81149f + 4a1e103 commit 8936bfe

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,12 @@ Consider the following functions:
6060
```js
6161
function logResult(fn) {
6262
return function(...args) {
63+
let result;
6364
try {
64-
const result = fn.call(this, ...args);
65+
result = fn.call(this, ...args);
6566
console.log(result);
6667
} catch (e) {
67-
console.error(result);
68+
console.error(e);
6869
throw e;
6970
}
7071
return result;

0 commit comments

Comments
 (0)