Skip to content

Commit 4b4f772

Browse files
jimmyhmillerrandycoulman
authored andcommitted
Change console.log for errors and warnings (facebook#1375)
Array.forEach is passed the following parameters: currentValue The current element being processed in the array. index The index of the current element being processed in the array. array - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach console.log takes multiple arguments. We only want to print the first one, the actually message.
1 parent 83726a6 commit 4b4f772

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/react-dev-utils/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,12 @@ compiler.plugin('done', function(stats) {
133133
}
134134
if (messages.errors.length) {
135135
console.log('Failed to compile.');
136-
messages.errors.forEach(console.log);
136+
messages.errors.forEach(e => console.log(e));
137137
return;
138138
}
139139
if (messages.warnings.length) {
140140
console.log('Compiled with warnings.');
141-
messages.warnings.forEach(console.log);
141+
messages.warnings.forEach(w => console.log(w));
142142
}
143143
});
144144
```

0 commit comments

Comments
 (0)