From 0b76f38f1e96a6c28ecd9fdf44cbba57efe8ca9a Mon Sep 17 00:00:00 2001 From: Bill Thornton Date: Tue, 4 Oct 2022 16:47:08 -0400 Subject: [PATCH] Fix misleading array mutation issue from sonar --- src/scripts/dom.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/scripts/dom.js b/src/scripts/dom.js index 8cc3e7d036..e336088c87 100644 --- a/src/scripts/dom.js +++ b/src/scripts/dom.js @@ -183,9 +183,9 @@ width = height * (16.0 / 9.0); } - return standardWidths.sort(function (a, b) { - return Math.abs(width - a) - Math.abs(width - b); - })[0]; + standardWidths.sort((a, b) => Math.abs(width - a) - Math.abs(width - b)); + + return standardWidths[0]; } /**