From 2feb7c18e9180392eff01cd1cc9bd245d8f0cc9f Mon Sep 17 00:00:00 2001 From: Tayfer Date: Sat, 28 Mar 2026 20:55:51 +0300 Subject: [PATCH] =?UTF-8?q?js=20lang=20solution=20=E2=84=961=20update?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/solution1.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/js/solution1.js b/js/solution1.js index 6943bc9..23f02bf 100644 --- a/js/solution1.js +++ b/js/solution1.js @@ -1,9 +1,8 @@ function tenToBin(x) { const l = []; - let i = x; - while (i !== 0) { - l.push(i % 2); - i = Math.trunc(i / 2); + while (x !== 0) { + l.push(x % 2); + x = Math.trunc(x / 2); } return l; }