From a40ff073536954be4a9ae2290c79d756051e2043 Mon Sep 17 00:00:00 2001 From: Andrew Henry Date: Sat, 16 May 2020 16:11:42 -0700 Subject: [PATCH] Updated guidance on anonymous functions --- CONTRIBUTING.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fd25bbad3c..dd21c97cb0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -144,9 +144,9 @@ JavaScript sources in Open MCT should: letters, with underscores between words (e.g. SOME_CONSTANT). They should always be declared as `const`s 1. File names should be the name of the exported class, plus a .js extension (e.g. SomeClassName.js). -1. Avoid anonymous functions, except when functions are short (a few lines) - and/or their inclusion makes sense within the flow of the code - (e.g. as arguments to a forEach call). +1. Avoid anonymous functions, except when functions are short (one or two lines) + and their inclusion makes sense within the flow of the code + (e.g. as arguments to a forEach call). Anonymous functions should always be arrow functions. 1. Named functions are preferred over functions assigned to variables. eg. ```JavaScript