From 603bde8885d4ec17a99d850691b072d09ab9b21a Mon Sep 17 00:00:00 2001 From: CorrWu Date: Fri, 22 Sep 2023 15:00:24 -0700 Subject: [PATCH] test: replace forEach with for of --- test/parallel/test-buffer-slice.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-buffer-slice.js b/test/parallel/test-buffer-slice.js index 05cbfba4733829..52720bb87b3cea 100644 --- a/test/parallel/test-buffer-slice.js +++ b/test/parallel/test-buffer-slice.js @@ -71,9 +71,9 @@ for (let i = 0, s = buf.toString(); i < buf.length; ++i) { ); } -expectedSameBufs.forEach(([buf1, buf2]) => { +for (const [buf1, buf2] of expectedSameBufs) { assert.strictEqual(Buffer.compare(buf1, buf2), 0); -}); +} const utf16Buf = Buffer.from('0123456789', 'utf16le'); assert.deepStrictEqual(utf16Buf.slice(0, 6), Buffer.from('012', 'utf16le'));