From 55f5e11dd937e476a80fc8ec4022c955f85b28a7 Mon Sep 17 00:00:00 2001 From: Ioanna M Dimitriou H <9728696+ioannad@users.noreply.github.com> Date: Wed, 14 Aug 2024 19:11:29 +0200 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Philip Chimento --- .../prototype/toLocaleString/resizable-buffer.js | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/test/built-ins/Array/prototype/toLocaleString/resizable-buffer.js b/test/built-ins/Array/prototype/toLocaleString/resizable-buffer.js index d7b60b49f6..c8768f47fe 100644 --- a/test/built-ins/Array/prototype/toLocaleString/resizable-buffer.js +++ b/test/built-ins/Array/prototype/toLocaleString/resizable-buffer.js @@ -21,17 +21,7 @@ for (let ctor of ctors) { // toLocaleString separator is implementation dependent. function listToString(list) { const comma = ['',''].toLocaleString(); - const len = list.length; - let result = ''; - if (len > 1) { - for (let i=0; i < len - 1 ; i++) { - result += list[i] + comma; - } - } - if (len > 0) { - result += list[len-1]; - } - return result; + return list.join(comma); } // Write some data into the array.