From 9457d2e57c9409f168ff0b072dff9812abc0c3a5 Mon Sep 17 00:00:00 2001 From: omnikrll Date: Wed, 24 Aug 2016 17:54:26 -0400 Subject: [PATCH] replace for loop with forEach --- .../IDE/components/EditorAccessibility.js | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/client/modules/IDE/components/EditorAccessibility.js b/client/modules/IDE/components/EditorAccessibility.js index 24c0ef95..f00cebc0 100644 --- a/client/modules/IDE/components/EditorAccessibility.js +++ b/client/modules/IDE/components/EditorAccessibility.js @@ -7,22 +7,18 @@ class EditorAccessibility extends React.Component { render() { let messages = []; if (this.props.lintMessages.length > 0) { - for (let i = 0; i < this.props.lintMessages.length; i++) { + this.props.lintMessages.forEach((lintMessage, i) => { messages.push(
  • - {this.props.lintMessages[i].severity} in line - {this.props.lintMessages[i].line} : - {this.props.lintMessages[i].message} + {lintMessage.severity} in line + {lintMessage.line} : + {lintMessage.message}
  • ); - } + }); } else { messages.push( - // react wants dom items from an array or - // iterator to have a key property. since this - // is the only item we're pushing to the array - // and don't have a counter to include, - // let's just call it 0. + // no array index so let's just call it 0

    There are no lint messages

    ); }