From 1e55116cc09f8972fc0e9f4e68db8b2cd551bb23 Mon Sep 17 00:00:00 2001 From: Christian Weimann Date: Tue, 15 Aug 2023 05:42:09 +0200 Subject: [PATCH] Improve readability of code --- utils/lib.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/utils/lib.js b/utils/lib.js index 11c63cb..969bb95 100644 --- a/utils/lib.js +++ b/utils/lib.js @@ -7,7 +7,7 @@ function compare(a, b, operator) { let logMsg = ''; let returnValue = undefined; try { - logMsg = 'Quantity comparison of ' + a + ', ' + b + ' with operator ' + operator; + logMsg = `Quantity comparison of ${a}, ${b} with operator ${operator}`; switch (operator) { case '==': returnValue = a.equal(b); @@ -29,7 +29,7 @@ function compare(a, b, operator) { break; } } catch(e) { - logMsg = 'Standard comparison of ' + a + ', ' + b + ' with operator ' + operator; + logMsg = `Standard comparison of ${a}, ${b} with operator ${operator}`; switch (operator) { case '==': returnValue = (a == b); @@ -53,7 +53,7 @@ function compare(a, b, operator) { } if (returnValue == undefined) { - console.error('No valid operator provided'); + console.error(`${operator} is no valid operator`); } else { console.debug(logMsg); }