From f1be3e5c4ab34613beb567eed4331da9d4a257b9 Mon Sep 17 00:00:00 2001 From: Jimmy Miller Date: Wed, 11 Jan 2017 15:15:58 -0500 Subject: [PATCH] Change console.log for errors and warnings (#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. --- packages/react-dev-utils/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-dev-utils/README.md b/packages/react-dev-utils/README.md index a9adffb6605..455996fcc59 100644 --- a/packages/react-dev-utils/README.md +++ b/packages/react-dev-utils/README.md @@ -133,12 +133,12 @@ compiler.plugin('done', function(stats) { } if (messages.errors.length) { console.log('Failed to compile.'); - messages.errors.forEach(console.log); + messages.errors.forEach(e => console.log(e)); return; } if (messages.warnings.length) { console.log('Compiled with warnings.'); - messages.warnings.forEach(console.log); + messages.warnings.forEach(w => console.log(w)); } }); ```